diff --git a/reference/docs-conceptual/setup/Installing-PowerShell-Core-on-macOS.md b/reference/docs-conceptual/setup/Installing-PowerShell-Core-on-macOS.md index bbb7bf1c17e0..d094851d531d 100644 --- a/reference/docs-conceptual/setup/Installing-PowerShell-Core-on-macOS.md +++ b/reference/docs-conceptual/setup/Installing-PowerShell-Core-on-macOS.md @@ -4,7 +4,7 @@ PowerShell Core supports macOS 10.12 and higher. All packages are available on our GitHub [releases][] page. Once the package is installed, run `pwsh` from a terminal. -### Installation via Homebrew on macOS 10.12 +### Installation of latest stable release via Homebrew on macOS 10.12 or higher [Homebrew][brew] is the preferred package manager for macOS. If the `brew` command is not found, you need to install Homebrew following [their instructions][brew]. @@ -44,6 +44,48 @@ brew cask upgrade powershell [brew]: http://brew.sh/ [cask]: https://caskroom.github.io/ +### Installation of latest preview release via Homebrew on macOS 10.12 or higher + +[Homebrew][brew] is the preferred package manager for macOS. +If the `brew` command is not found, you need to install Homebrew following [their instructions][brew]. + +Once you've installed Homebrew, installing PowerShell is easy. +First, install [Homebrew-Cask][cask], so you can install more packages and install [Cask-Versions][cask-version] which lets you install alternative versions of packages: + +```sh +brew tap caskroom/cask +brew tap caskroom/versions +``` + +Now, you can install PowerShell: + +```sh +brew cask install powershell-preview +``` + +Finally, verify that your install is working properly: + +```sh +pwsh-preview +``` + +When new versions of PowerShell are released, +simply update Homebrew's formulae and upgrade PowerShell: + +```sh +brew update +brew cask upgrade powershell-preview +``` + +> [!NOTE] +> The commands above can be called from within a PowerShell (pwsh) host, +> but then the PowerShell shell must be exited and restarted to complete the upgrade. +> and refresh the values shown in $PSVersionTable. + +[brew]: http://brew.sh/ +[cask]: https://caskroom.github.io/ +[cask-versions]: https://github.com/Homebrew/homebrew-cask-versions + ### Installation via Direct Download Download the PKG package