Installing PowerShell on Red Hat Enterprise Linux (RHEL)

All packages are available on our GitHub releases page. Before installing, check the list of Supported versions below. After the package is installed, run pwsh from a terminal. Run pwsh-preview if you installed a preview release.


PowerShell 7.3 is an in-place upgrade that removes previous versions of PowerShell 7. Preview versions of PowerShell can be installed side-by-side with other versions of PowerShell. If you need to run PowerShell 7.3 side-by-side with a previous version, reinstall the previous version using the binary archive method.

RHEL 7 uses yum and RHEL 8 and higher uses the dnf package manager.

Installation via the Package Repository

Microsoft builds and supports a variety of software products for Linux systems and makes them available via Linux packaging clients (apt, dnf, yum, etc). These Linux software packages are hosted on the Linux package repository for Microsoft products,, also known as PMC.

Installing PowerShell from PMC is the preferred method of installation. The PowerShell RPMs aren't published to the RHEL 9 repository yet. For RHEL 9, you need to install PowerShell via direct download.


This script only works for supported versions of RHEL.

# Prerequisites

# Get version of RHEL
source /etc/os-release
if [ $(bc<<<"$VERSION_ID < 8") = 1 ]
then majorver=7
elif [ $(bc<<<"$VERSION_ID < 9") = 1 ]
then majorver=8
else majorver=9

# Register the Microsoft RedHat repository
curl -sSL -O$majorver/packages-microsoft-prod.rpm

# Register the Microsoft repository keys
sudo rpm -i packages-microsoft-prod.rpm

# Delete the repository keys after installing
rm packages-microsoft-prod.rpm

# RHEL 7.x uses yum and RHEL 8+ uses dnf
if [ $(bc<<<"$majorver < 8") ]
    # Update package index files
    sudo yum update
    # Install PowerShell
    sudo yum install powershell -y
    # Update package index files
    sudo dnf update
    # Install PowerShell
    sudo dnf install powershell -y

Installation via direct download

PowerShell 7.2 introduced a universal package that makes installation easier. Download the universal package from the releases page onto your RHEL machine.

The link to the current version is:

  • PowerShell 7.3.7 universal package for supported versions of RHEL
  • PowerShell 7.2.14 universal package for supported versions of RHEL
  • PowerShell 7.4-preview.5 universal package for supported versions of RHEL

The following shell script downloads and installs the current preview release of PowerShell. You can change the URL to download a the version of PowerShell you want to install.

On RHEL 8 or 9:

sudo dnf install

On RHEL 7:

sudo yum install

Uninstall PowerShell

On RHEL 8 or 9:

sudo dnf remove powershell

On RHEL 7:

sudo yum remove powershell

Support for Arm processors

PowerShell 7.2 and newer supports running on RHEL using a 64-bit Arm processor. Use the binary archive installation method of installing PowerShell that's described in Alternate ways to install PowerShell on Linux.

PowerShell paths

  • $PSHOME is /opt/microsoft/powershell/7/
  • The profiles scripts are stored in the following locations:
    • AllUsersAllHosts - $PSHOME/profile.ps1
    • AllUsersCurrentHost - $PSHOME/Microsoft.PowerShell_profile.ps1
    • CurrentUserAllHosts - ~/.config/powershell/profile.ps1
    • CurrentUserCurrentHost - ~/.config/powershell/Microsoft.PowerShell_profile.ps1
  • Modules are stored in the following locations:
    • User modules - ~/.local/share/powershell/Modules
    • Shared modules - /usr/local/share/powershell/Modules
    • Default modules - $PSHOME/Modules
  • PSReadLine history is recorded in ~/.local/share/powershell/PSReadLine/ConsoleHost_history.txt

PowerShell respects the XDG Base Directory Specification on Linux.

Supported versions

The following table is a list of currently supported versions of PowerShell and the versions of RHEL they're supported on. These versions remain supported until either the version of PowerShell reaches end-of-support or the version of RHEL reaches end-of-support.

  • The Supported icon indicates that the version of the OS or PowerShell is still supported
  • The Out of Support icon indicates the version of PowerShell is no longer supported on that version of the OS
  • The In Test icon indicates that we haven't finished testing PowerShell on that OS
  • The Not Supported icon indicates that the version of the OS or PowerShell isn't supported
  • When both the version of the OS and the version of PowerShell have a Supported icon, that combination is supported
RHEL 7.2 (LTS-current) 7.3 7.4 (preview)
Supported 9 Supported Supported Supported
Supported 8 Supported Supported Supported
Supported 7 Supported Supported Not Supported

PowerShell is supported on RHEL for the following processor architectures.

RHEL 7.2 (LTS-current) 7.3 7.4 (preview)
All supported versions x64 x64 x64

Installation support

Microsoft supports the installation methods in this document. There may be other methods of installation available from other third-party sources. While those tools and methods may work, Microsoft can't support those methods.