PowerShell Core on Mac OS (PowerShell)

PowerShell Core running on Mac OS Mojave (10.14)

PowerShell is an amazing command line, scripting & programming tool that I have used a few times on Microsoft Windows. PowerShell Core is now available for Mac OS and so today I am going to look at installing it on my MacBook.

Note: I am installing PowerShell Core onto Mac OS Mojave (specifically Mac OS 10.14.5).

The recommended approach to install PowerShell Core on Mac OS is to use Homebrew (https://brew.sh/). Homebrew adds additional features to Mac OS that power users will probably find very helpful. For a list of the additional features see https://formulae.brew.sh/formula/

If you do not have Homebrew installed then it can be installed via the following 1 line command in the terminal:

/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

I recommend visiting https://brew.sh/ before installing Homebrew.

Installing Homebrew (Mac OS)
Installing Homebrew (Mac OS)

With Homebrew installed we can ask it to install PowerShell Core using the command:

brew cask install powershell

Homebrew installing PowerShell
Homebrew installing PowerShell

If Homebrew successfully installs PowerShell it should show a message of a beer and a success message. PowerShell can then be started using the command:

pwsh

geektechstuff_powershell_core_mac_os1
pwsh to start PowerShell

And then the PowerShell command prompt will show.

geektechstuff_powershell_core_mac_os3
PowerShell command prompt on Mac OS