PowerShell is supported on macOS 10.12 and higher. All packages are available on GitHub releases page. To install PowerShell on macOS, the Homebrew package manager is utilized.
To have the Homebrew package manager installed on your device, see https://techdirectarchive.com/2020/03/20/how-to-install-homebrew-on-macos/
The steps below are ways to install PowerShell on macOS
Via Homebrew: Launch your iTerm (Terminal emulator for macOS)
– Run the below commands to install Powershell
brew cask install powershell
After the package is installed, run “pwsh” from a terminal.
Now, you can continue running some Command Prompt commands and PowerShell cmdlets as well on your macOS. See some examples below.
Now you can run PowerShell cmdlets right inside your macOS device 🙂
To uninstall PowerShell from your device, run the following command below
brew cask uninstall powershell
Note: This is only applicable if you used the homebrew package manager to install PowerShell, otherwise you will have to uninstall PowerShell manually