How to install PowerShell Core on Windows, Linux, and macOS

PowerShell Core is available to Windows clients, as well as macOS and Linux devices. Learn how to install Microsoft's PSC on these operating systems.

Microsoft Silicon Valley Center - Mountain View, CA

Image: jejim, Getty Images/iStock

Through the years, Microsoft has made inroads in the open source space in an effort to transition to a cloud-focused business platform. With its purchase of GitHub in 2018, Microsoft has doubled down on this commitment and continued the momentum by retooling its popular PowerShell management framework from a Windows-only tool to one that now runs on macOS, Linux, and ARM-based hardware.

Newer releases of PowerShell were retitled PowerShell Core (PSC) to differentiate between the prior legacy, Windows-only releases and current universal versions that support multiple OSes to limit confusion between versions. Microsoft still supports the legacy PowerShell on Windows, but the current version (5.1) will not see any new cmdlets added to the framework--with that privilege solely going to future PowerShell Core releases.

PowerShell Core has undergone a few changes during the development process so it can work across all OS types--one major change is the number of cmdlets available to administrators, which is decidedly less than legacy PowerShell has access to. Microsoft insists it's only a matter of time before cmdlets are migrated to PowerShell Core. Fortunately for Windows users, legacy PowerShell and PowerShell Core may be installed side-by-side to help with the transition.

Microsoft has moved over development to a hosted account on GitHub with full support from Microsoft and the open source community to aid in the continued development, testing, and release of future PowerShell versions. As a side benefit, many users post the modules and scripts they create for everyone to utilize in their managed environments.

SEE: PowerShell scripting: Seven tips to reduce errors (free PDF) (TechRepublic)

Before installing PowerShell Core, you'll need to adhere to specific requirements, which depend predominantly on the version of the base operating system being installed on. The requirements are included in the respective sections.

How to install PowerShell Core on Windows

Requirements: Universal C Runtime for Windows versions prior to Windows 10; Windows Management Framework 4.0 or later on Windows 7 and Server 2008 R2.

  1. Download the MSI for your OSes architecture from the GitHub releases page.
  2. Execute the MSI to install it manually or use the following command to install it silently.

msiexec.exe /package /path/to/powershell.msi /quiet

How to install PowerShell Core on macOS

Requirement: macOS 10.12 or later

  1. Download the PKG for macOS from the GitHub releases page.
  2. Execute the PKG to install it manually or use the following command to install it silently if your Mac is configured to use the Homebrew package manager.

brew cask install powershell

How to install PowerShell Core on Linux

Requirements: Ubuntu 16.04/18.04/18.10/19.04, Debian 8/9, CentOS 7, RHEL 7, openSUSE, Fedora, Arch Linux, Snap Package, Kali, Raspian

  1. Launch Terminal and enter the following command for your distribution(s):

Ubuntu/Debian: sudo apt-get install -y powershell

CentOS/RHEL: sudo yum install -y powershell

Fedora: sudo dnf install -y powershell

How to install PowerShell Core on ARM (Linux)

Requirements: (Raspian) Pi 2/3 boards only; Raspian Stretch installed.

  1. Launch Terminal and enter the following commands (or execute script).

# Prerequisites

# Update package lists

sudo apt-get update

# Install libunwind8 and libssl1.0

# Regex is used to ensure that we do not install libssl1.0-dev, as it is a variant that is not required

sudo apt-get install '^libssl1.0.[0-9]$' libunwind8 -y

###################################

# Download and extract PowerShell

# Grab the latest tar.gz

wget https://github.com/PowerShell/PowerShell/releases/download/v6.2.0/powershell-6.2.0-linux-arm32.tar.gz

# Make folder to put powershell

mkdir ~/powershell

# Unpack the tar.gz file

tar -xvf ./powershell-6.2.0-linux-arm32.tar.gz -C ~/powershell

# Start PowerShell

~/powershell/pwsh

How to install PowerShell Core on ARM (Windows IoT)

Requirement: Windows PowerShell

1. Launch PowerShell on the workstation and enter the following cmdlet to create a PSSession to the target device:

$s = New-PSSession -ComputerName Target_Device_IP -Credential Administrator_account

2. Download the ZIP package and copy it to the target with the following cmdlet:

Copy-Item .\path\to\powershell.zip -Destination U:\users\Administrator_account\Downloads -ToSession $s

3. Connect remotely to the device session and install PowerShell script with the following cmdlets:

Enter-PSSession $s

Set-Location U:\users\Administrator_account\Downloads

Expand-Archive .\powershell.zip

4. Enter the following cmdlet to set up Remoting via PowerShell:

Set-Location .\powershell.zip

.\Install-PowerShellRemoting.ps1 -PowerShellHome

5. This final cmdlet will configure PowerShell Core on the target device:

Enter-PSSession -ComputerName Target_Device_IP -Credential Administrator_account -Configuration powershell.

Also see