Skip to content

macos arm64 brew pwsh path update needed... #13067

@NJT145

Description

@NJT145

Type of issue

Missing information

Feedback

for macos arm64 pc, pwsh path is /opt/homebrew/bin/pwsh . so, for the path, we can use this:


# Add Homebrew package management to the PowerShell environment.
# This logic mirrors the official Homebrew installation script,
# determining the installation path based on Apple Silicon vs Intel.
$homebrew_prefix = if ((uname -m) -eq "arm64") { "/opt/homebrew" } else { "/usr/local" }
Invoke-Expression (& "${homebrew_prefix}/bin/brew" shellenv | Out-String)
# TODO: Use $homebrew_prefix here, instead of using /usr/local/
Remove-Variable homebrew_prefix

You can use homebrew_prefix at TODO line in order to reach the bin location path...

Page URL

https://learn.microsoft.com/en-us/powershell/scripting/install/alternate-install-methods?view=powershell-7.6#install-on-macos-using-homebrew

Content source URL

https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/docs-conceptual/install/alternate-install-methods.md

Author

@sdwheeler

Platform Id

3c850702-3566-fa22-47e4-1934ef0ec70c

Document Id

de52bf12-bfdf-d860-ae4e-9a4334ec8c50

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions