No Search Result

Installing PowerShell on Windows

By Lazy-Fixer・ Published in deploymentJanuary 21, 2025・ 1 min read

Installing PowerShell on Windows

In this article:

  • Installing PowerShell using Winget (recommended)
  • Installing the MSI package
  • Installing the ZIP package
  • Installing as a .NET Global tool

There are several ways to install PowerShell on Windows, each suited to different workflows and use cases. Choose the method that fits your specific needs.

  • Winget: Recommended for installing PowerShell on Windows client systems
  • MSI package: Ideal for Windows Server and enterprise deployment
  • ZIP package: The simplest choice for "side-loading" or managing multiple versions
  • .NET Global tool: A good option for .NET developers who already use other global tools
  • Microsoft Store: An easy installation method for casual users, though it has certain limitations

Note
The commands provided in this article are for the latest stable PowerShell release. If you wish to install a different version, modify the command to specify the version you require. Use the links below to access the release pages for each version on GitHub:

The download links for all packages are available in the "Assets" section on the release page. This section may be collapsed, so you might need to click to expand it.

Install PowerShell using Winget (Recommended)

Winget, the Windows Package Manager, is a command-line tool that allows users to discover, install, upgrade, remove, and configure applications on Windows client systems. It serves as the client interface to the Windows Package Manager service and is bundled by default in Windows 11 and modern Windows 10 versions as the App Installer.

Note
For system requirements and installation instructions, refer to the Winget documentation. Winget is not available on Windows Server 2022 or earlier versions. Starting from Windows Server 2025 Preview Build 26085, Winget is included only for Windows Server with Desktop Experience. For more details, see Announcing Windows Server Preview Build 26085.

You can use the following commands to install PowerShell using the published Winget packages:

Search for the latest version of PowerShell

winget search Microsoft.PowerShell

Output:

Name                Id                          Version   Source  
-------------------------------------------------------------------
PowerShell          Microsoft.PowerShell        7.4.6.0   winget  
PowerShell Preview  Microsoft.PowerShell.Preview 7.5.0.101 winget

Install PowerShell or PowerShell Preview using the id parameter

winget install --id Microsoft.PowerShell --source winget  
winget install --id Microsoft.PowerShell.Preview --source winget  

Note
On x86 or x64 systems, Winget installs the MSI package. On Arm64 systems, Winget installs the Microsoft Store (MSIX) package. For more details, refer to Installing from the Microsoft Store.

Installing the MSI Package

To install PowerShell on Windows, you can download the installer from the following GitHub links:

After downloading, double-click the installer and follow the prompts. The installer will create a shortcut in the Windows Start Menu.

By default, PowerShell is installed to $env:ProgramFiles\PowerShell\<version>. You can launch PowerShell from the Start Menu or by running $env:ProgramFiles\PowerShell\<version>\pwsh.exe from a command prompt.

Note
PowerShell 7.4 installs in a new directory and runs alongside Windows PowerShell 5.1. PowerShell 7.4 is an in-place upgrade that removes older versions of PowerShell 7. Preview versions of PowerShell can be installed side-by-side with other versions of PowerShell.

PowerShell 7.4 installs to $env:ProgramFiles\PowerShell\7, and the $env:ProgramFiles\PowerShell\7 folder is added to $env:PATH. If you want to install a different version alongside PowerShell 7.4, use the ZIP installation method and install the other version in a separate folder.

Microsoft Update Support in PowerShell 7.2 and Newer

PowerShell 7.2 and later versions support Microsoft Update. This feature ensures you receive the latest PowerShell updates via your usual Microsoft Update channels (e.g., Windows Update for Business, WSUS, or Microsoft Endpoint Configuration Manager).

The PowerShell MSI package includes the following command-line options for configuring update preferences:

  • USE_MU:

    • 1 (default): Opts into updating through Microsoft Update, WSUS, or Configuration Manager
    • 0: Disables updating through Microsoft Update
  • ENABLE_MU:

    • 1 (default): Enables Microsoft Update for automatic updates
    • 0: Disables Microsoft Update for automatic updates

Note
Enabling updates may have been set in a previous installation or manually configured. Using ENABLE_MU=0 does not remove existing settings. Group Policy settings set by an administrator may override this configuration.

For further information, refer to the PowerShell Microsoft Update FAQ.

Install the MSI Package from the Command Line

You can also install the MSI package from the command line, which allows administrators to deploy PowerShell silently. The MSI package includes several properties for customizing the installation options:

  • ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL: Adds the "Open PowerShell" option to the right-click context menu in Windows Explorer
  • ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL: Adds the "Run with PowerShell" option to the right-click context menu
  • ENABLE_PSREMOTING: Enables PowerShell remoting during installation
  • REGISTER_MANIFEST: Registers the Windows Event Logging manifest
  • ADD_PATH: Adds PowerShell to the Windows PATH environment variable
  • DISABLE_TELEMETRY: Disables PowerShell's telemetry feature
  • INSTALLFOLDER: Specifies the installation directory (default: $env:ProgramFiles\PowerShell\)

For a silent installation with all options enabled, use the following command:

msiexec.exe /package PowerShell-7.4.6-win-x64.msi /quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL=1 ENABLE_PSREMOTING=1 REGISTER_MANIFEST=1 USE_MU=1 ENABLE_MU=1 ADD_PATH=1

For more information on command-line options, see the Msiexec.exe Command-Line Options.

Installing the ZIP Package

If you prefer to deploy PowerShell manually or need advanced installation options, you can use the ZIP package. Download one of the following ZIP archives:

After downloading, you may need to unblock the file using the Unblock-File cmdlet. Extract the contents to your desired location, and run pwsh.exe from that location. Unlike MSI installation, the ZIP archive doesn’t check for prerequisites. Ensure you meet the necessary requirements for remoting over WSMan.

This method is suitable for ARM-based systems like the Microsoft Surface Pro X. For best results, install PowerShell in the $env:ProgramFiles\PowerShell\7 directory.

Install as a .NET Global Tool

If you have the .NET Core SDK installed, you can install PowerShell as a .NET Global tool:

dotnet tool install --global PowerShell

The .NET tool installer will add $HOME\.dotnet\tools to your $env:PATH. However, the currently running shell won't pick up this change, so you’ll need to start a new shell and type pwsh to launch PowerShell.

Installing from the Microsoft Store

You can install PowerShell directly from the Microsoft Store. This method is particularly user-friendly and automatically handles updates through Windows.

Advantages of the Microsoft Store Package:

  • Automatic updates built into Windows
  • Integrates with distribution systems like Intune and Configuration Manager
  • Available for x86, x64, and ARM64 systems

Limitations:
The Microsoft Store package runs in a sandbox, which restricts access to certain file and registry locations. For example, remote sessions cannot connect to PowerShell installed via the Microsoft Store. However, user-level configurations and SSH rem

oting are supported.

Changes that require writing to $PSHOME (like Register-PSSessionConfiguration and Set-ExecutionPolicy) are not supported in a Store-installed instance of PowerShell.

Note
Since PowerShell 7.2, the Store package is exempt from file and registry virtualization, allowing changes to persist outside the sandbox. However, changes to the root folder of the application are still blocked.

Installing a Preview Version

PowerShell 7 Preview versions install to $env:ProgramFiles\PowerShell\7-preview, enabling you to run them side-by-side with stable versions. PowerShell 7.4 is the next preview release.

Upgrading an Existing Installation

When upgrading, it's best to use the same method you originally used to install PowerShell. If you're unsure, check the $PSHOME variable to determine where PowerShell is installed.

To check for available upgrades via Winget, run:

winget list --name PowerShell --upgrade-available

Note that PowerShell will not upgrade from an LTS version to a non-LTS version, so you’ll need to install the new version via the MSI package for an upgrade.

Deploying on Windows 10 IoT Enterprise

Windows 10 IoT Enterprise includes Windows PowerShell, which can be used to deploy PowerShell 7. For detailed instructions, follow the steps outlined in the article.

Deploying on Windows 10 IoT Core

For Windows 10 IoT Core, use the Import-PSCoreRelease command to include PowerShell 7 in the shipping image.

Deploying on Nano Server

PowerShell can be deployed on Nano Server either offline (by mounting the VHD and extracting the ZIP package) or online (via a PowerShell session). For detailed instructions, follow the guidance provided in the article.

PowerShell Remoting

PowerShell supports remoting over both WSMan and SSH. For more information, see the relevant sections on SSH and WSMan remoting.

Supported Versions of Windows

PowerShell 7.4 and higher can be installed on Windows 10 (build 1607 and higher), Windows 11, Windows Server 2016 and later. Docker images for Windows Server 2022 and higher are also available.