Skip to content

Commit

Permalink
powershell: update caveats
Browse files Browse the repository at this point in the history
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.

Fixes #170589.
  • Loading branch information
ZhongRuoyu committed Apr 5, 2024
1 parent 56455a4 commit a9e6382
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Casks/p/powershell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
]

caveats <<~EOS
To use Homebrew in PowerShell, set:
To use Homebrew in PowerShell, run the following in a PowerShell session:
New-Item -Path (Split-Path -Parent -Path $PROFILE.CurrentUserAllHosts) -ItemType Directory -Force
Add-Content -Path $PROFILE.CurrentUserAllHosts -Value '$(#{HOMEBREW_PREFIX}/bin/brew shellenv) | Invoke-Expression'
EOS
end

0 comments on commit a9e6382

Please sign in to comment.