You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
==> Caveats
To use Homebrew in PowerShell, set:
Add-Content -Path $PROFILE.CurrentUserAllHosts -Value '$(/opt/homebrew/bin/brew shellenv) | Invoke-Expression'
this is not very self-explanatory, obviously, there's no Add-Content command in path, it should be fed to powershell somehow. after brew ls powershell (useless for pkg cask -- doesn't list files) and later cat /Applications/PowerShell.app/Contents/MacOS/PowerShell.sh figured I should feed it to pwsh program
$ pwsh
PowerShell 7.4.1
PS /Users/glen> Add-Content -Path $PROFILE.CurrentUserAllHosts -Value '$(/opt/homebrew/bin/brew shellenv) | Invoke-Expression'
Add-Content: Could not find a part of the path '/Users/glen/.config/powershell/profile.ps1'.
PS /Users/glen>
apparently, the caveat needs to include some install -d ~/.config/powershell first.
perhaps also use pwsh -c to the command so the command wouldn't need to be interactive?
note: I'm not powershell user, just installed it for the first time to run some script.
Command that failed
pwsh
Output of command with --verbose --debug
not relevant - feature request to documentation
Output of brew doctor and brew config
not relevant - feature request to documentation
Output of brew tap
not relevant - feature request to documentation
The text was updated successfully, but these errors were encountered:
1. Clarify that the commands need to be run in a PowerShell session.
2. Make sure the directory is created before attempting to write to the
profile.
FixesHomebrew#170589.
1. Clarify that the commands need to be run in a PowerShell session.
2. Make sure the directory is created before attempting to write to the
profile.
FixesHomebrew#170589.
Verification
--force
.brew update-reset && brew update
and retried my command.brew doctor
, fixed as many issues as possible and retried my command.Description of issue
brew install powershell
prints this caveat:this is not very self-explanatory, obviously, there's no
Add-Content
command in path, it should be fed to powershell somehow. afterbrew ls powershell
(useless for pkg cask -- doesn't list files) and latercat /Applications/PowerShell.app/Contents/MacOS/PowerShell.sh
figured I should feed it topwsh
programapparently, the caveat needs to include some
install -d ~/.config/powershell
first.perhaps also use
pwsh -c
to the command so the command wouldn't need to be interactive?note: I'm not powershell user, just installed it for the first time to run some script.
Command that failed
pwsh
Output of command with
--verbose --debug
Output of
brew doctor
andbrew config
Output of
brew tap
The text was updated successfully, but these errors were encountered: