T
T
Today I learned
Search…
How to install PowerShell core on MacOS
NOTE: Original instructions are here, I have just duplicated here for easy access.

How to install

Do the following from the macOS console:
Install Homebrew. If you dont already have it, run this:
1
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Copied!
Install Homebrew-Cask so future installations of software via brew is much nicer.
1
brew tap caskroom/cask
Copied!
Now you can install PowerShell by running:
1
brew cask install powershell
Copied!
You can be sure it is working by running:
1
pwsh
Copied!
This should give you the powershell prompt and away you go!

How to upgrade

Run the following from the console:
1
brew update
2
brew cask upgrade powershell
Copied!
That should do it.

How to re-install

If for whatever reason you want to reinstall PowerShell use:
1
brew cask reinstall powershell
Copied!

How to remove

If you are nuts and want to remove PowerShell from macOS run:
1
brew cask uninstall powershell
Copied!