powershell, macos,

How to install PowerShell on macOS

Jul 16, 2021 · 1 min read · Post a comment

As a DevOps engineer, most likely we would prefer to work with our cool and comfy MacBook Pros. And if you are working with Azure, you will most probably need to install PowerShell at some point. There are few ways to do it, so let’s see how we can install PowerShell the easiest way possible.

Prerequisites

  • Homebrew

Install PowerShell via the famous package manager Brew

Step 1. Open Terminal and update Brew.

brew update

Step 2. Upgrade packages if any.

brew upgrade

Step 3. Install PowerShell.

brew install --cask powershell

Step 4. Verify installation.

pwsh

Output:

➜  ~ pwsh
PowerShell 7.1.3
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

PS /Users/devcoops> 

Uninstall PowerShell

brew uninstall --cask powershell

Conclusion

I would always consider installing any kind of software on macOS via Brew. It’s more effective to handle things via package manager instead of a bunch of .pkg files scattered around the file system. Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.