How To Install PowerShell on macOS

Can I install and Use PowerShell on my macOS?. PowerShell is a cross-platform task automation and configuration management framework, consisting of a command-line shell and scripting language. Unlike most shells, which accept and return text, PowerShell is built on top of the . NET Common Language Runtime (CLR), and accepts and returns.

For the installation of PowerShell 7.0 or higher, macOS 10.13 and higher is required. PowerShell packages for macOS, Windows and Linux packages are available on the GitHub releases page. There are several ways you can reference to install PowerShell on macOS. You can check out the link on how to Install Older Versions of macOS if you need older release of macOS.

We’ll be using the Homebrew installation method. Homebrew is the preferred package manager for macOS and can easily be installed using the following command in your terminal.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

When Homebrew has been installed you can then use the brew command to install PowerShell on macOS.

brew install --cask powershell

The installation should not take long to completetion.

==> Downloading https://formulae.brew.sh/api/cask.jws.json
==> Caveats
To use Homebrew in PowerShell, run the following in a PowerShell session:
  New-Item -Path (Split-Path -Parent -Path $PROFILE.CurrentUserAllHosts) -ItemType Directory -Force
  Add-Content -Path $PROFILE.CurrentUserAllHosts -Value '$(/usr/local/bin/brew shellenv) | Invoke-Expression'

==> Downloading https://github.com/PowerShell/PowerShell/releases/download/v7.5.0/powershell-7.5.0-osx-x64.pkg
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/49609581/ea8c865c-4bc6-4fdf-9243-fb75c5e02762?X-
########################################################################################################################################### 100.0%
==> Installing Cask powershell
==> Running installer for powershell with sudo; the password may be necessary.
Password:
installer: Package name is PowerShell - 7.5.0
installer: Installing at base path /
installer: The install was successful.
🍺  powershell was successfully installed!

You can perform updates at any point in time by using these commands:

brew update
brew upgrade powershell --cask

Verify the installation was successful by running the command below.

$ pwsh
PowerShell 7.5.0
Copyright (c) Microsoft Corporation.

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

PS /Users/gedeon>

Output version details:

PS /Users/gedeon> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.5.0
PSEdition                      Core
GitCommitId                    7.5.0
OS                             Darwin 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan  2 20:22:00 PST 2025; root:xnu-11215.81.4~3/RELEASE_X86_64
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Important installation Paths:

  • $PSHOME is /usr/local/microsoft/powershell/7.1.0/
  • User profiles will be read from ~/.config/powershell/profile.ps1
  • Default profiles will be read from $PSHOME/profile.ps1
  • User modules will be read from ~/.local/share/powershell/Modules
  • Shared modules will be read from /usr/local/share/powershell/Modules
  • Default modules will be read from $PSHOME/Modules
  • PSReadline history will be recorded to ~/.local/share/powershell/PSReadLine/ConsoleHost_history.txt

How To Uninstall PowerShell on macOS

If you installed PowerShell with Homebrew, use the following command to uninstall:

$ brew --cask uninstall powershell
==> Uninstalling Cask powershell
==> Uninstalling packages with sudo; the password may be necessary:
com.microsoft.powershell
Password:
==> Purging files for version 7.5.0 of Cask powershell
==> Autoremoving 3 unneeded formulae:
libtermkey
libvterm
msgpack
Uninstalling /usr/local/Cellar/libtermkey/0.22... (33 files, 141.5KB)
Uninstalling /usr/local/Cellar/msgpack/6.0.0... (38 files, 202.4KB)
Uninstalling /usr/local/Cellar/libvterm/0.3.2... (12 files, 321.9KB)

For the actual PowerShell usage guides the official documentation should be your next place.

Related articles:

Your IT Journey Starts Here!

Ready to level up your IT skills? Our new eLearning platform is coming soon to help you master the latest technologies.

Be the first to know when we launch! Join our waitlist now.

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Post

Kitty is a cross-platform GPU-based terminal emulator. It is feature-rich, written in Python and Objective C. It can easily be […]

Alacritty is the fastest available Linux terminal emulator. It makes use of GPU (Graphical Processing Unit) for rendering ensuring optimization […]

On this tutorial, we will look at how to install and configure eDEX-UI terminal emulator on Linux Mint. eDex-UI is […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.