Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit focus mode

Installing PowerShell on Windows

  • 2025-07-03
Feedback

In this article

There are multiple ways to install PowerShell in Windows. Each install method is designed to supportdifferent scenarios and workflows. Choose the method that best suits your needs.

  • WinGet - Recommended way to install PowerShell on Windows clients
  • MSI package - Best choice for Windows Servers and enterprise deployment scenarios
  • ZIP package - Easiest way to "side load" or install multiple versions
    • Use this method for Windows Nano Server, Windows IoT, and Arm-based systems
  • .NET Global tool - A good choice for .NET developers that install and use other global tools
  • Microsoft Store package - An easy way to install for casual users of PowerShell but haslimitations

Note

The installation commands in this article are for the latest stable release of PowerShell. Toinstall a different version of PowerShell, adjust the command to match the version you need. Thefollowing links direct you to the latest release page for each version on GitHub.

Download links for every package are found in theAssets section of the Release page. TheAssets section may be collapsed, so you may need to click to expand it.

Install PowerShell using WinGet (recommended)

WinGet, the Windows Package Manager, is a command-line tool enables users to discover, install,upgrade, remove, and configure applications on Windows client computers. This tool is the clientinterface to the Windows Package Manager service. Thewinget command-line tool is bundled withWindows 11 and modern versions of Windows 10 by default as theApp Installer.

Note

See thewinget documentation for a list of system requirements and install instructions.winget isn't available on Windows Server 2022 or earlier versions. Windows Server 2025 PreviewBuild 26085 and later includeswinget forWindows Server with Desktop Experience only.

The following commands can be used to install PowerShell using the publishedwinget packages:

Search for the latest version of PowerShell

winget search Microsoft.PowerShell
Name               Id                           Version Source---------------------------------------------------------------PowerShell         Microsoft.PowerShell         7.5.2.0 wingetPowerShell Preview Microsoft.PowerShell.Preview 7.6.0.4 winget

Install PowerShell or PowerShell Preview using theid parameter

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

Note

On Windows systems using X86 or X64 processor,winget installs the MSI package. On systems usingthe Arm64 processor,winget installs the Microsoft Store (MSIX) package. For more information,seeInstalling from the Microsoft Store.

Installing the MSI package

To install PowerShell on Windows, use the following links to download the install package fromGitHub.

Once downloaded, double-click the installer file and follow the prompts.

The installer creates a shortcut in the Windows Start Menu.

  • By default the package is installed to$Env:ProgramFiles\PowerShell\<version>
  • You can launch PowerShell via the Start Menu or$Env:ProgramFiles\PowerShell\<version>\pwsh.exe

Note

PowerShell 7.5 installs to a new directory and runs side-by-side with Windows PowerShell 5.1.PowerShell 7.5 is an in-place upgrade that removes previous versions of PowerShell 7. Previewversions of PowerShell can be installed side-by-side with other versions of PowerShell.

  • PowerShell 7.5 is installed to$Env:ProgramFiles\PowerShell\7
  • The$Env:ProgramFiles\PowerShell\7 folder is added to$Env:PATH

If you need to run PowerShell 7.5 side-by-side with other versions, use theZIP installmethod to install the other version to a different folder.

Support for Microsoft Update in PowerShell 7.2 and newer

PowerShell 7.2 and newer has support for Microsoft Update. When you enable this feature, you'll getthe latest PowerShell 7 updates in your traditional Microsoft Update (MU) management flow, whetherthat's with Windows Update for Business, WSUS, Microsoft Endpoint Configuration Manager, or theinteractive MU dialog in Settings.

The PowerShell MSI package includes following command-line options:

  • USE_MU - This property has two possible values:
    • 1 (default) - Opts into updating through Microsoft Update, WSUS, or Configuration Manager
    • 0 - Don't opt into updating through Microsoft Update, WSUS, or Configuration Manager
  • ENABLE_MU
    • 1 (default) - Opts into using Microsoft Update for Automatic Updates
    • 0 - Don't opt into using Microsoft Update

Note

Enabling updates may have been set in a previous installation or manual configuration. UsingENABLE_MU=0 doesn't remove the existing settings. Also, this setting can be overruled by GroupPolicy settings controlled by your administrator.

For more information, see thePowerShell Microsoft Update FAQ.

Install the MSI package from the command line

MSI packages can be installed from the command line allowing administrators to deploy packageswithout user interaction. The MSI package includes the following properties to control theinstallation options:

  • ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL - This property controls the option for adding theOpen PowerShell item to the context menu in Windows Explorer.
  • ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL - This property controls the option for adding theRun with PowerShell item to the context menu in Windows Explorer.
  • ENABLE_PSREMOTING - This property controls the option for enabling PowerShell remoting duringinstallation.
  • REGISTER_MANIFEST - This property controls the option for registering the Windows EventLogging manifest.
  • ADD_PATH - This property controls the option for adding PowerShell to the Windows PATHenvironment variable.
  • DISABLE_TELEMETRY - This property controls the option for disabling PowerShell's telemetry bysetting thePOWERSHELL_TELEMETRY_OPTOUT environment variable.
  • INSTALLFOLDER - This property controls the installation directory. The default is$Env:ProgramFiles\PowerShell\. This is the location where the installer creates the versionedsubfolder. You can't change the name of the versioned subfolder.
    • For current releases, the versioned subfolder is7
    • For preview releases, the versioned subfolder is7-preview

The following example shows how to silently install PowerShell with all the install options enabled.

msiexec.exe /package PowerShell-7.5.2-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 a full list of command-line options forMsiexec.exe, seeCommand line options.

Installing the ZIP package

PowerShell binary ZIP archives are provided to enable advanced deployment scenarios. Download one ofthe following ZIP archives from thecurrent release page.

Depending on how you download the file you may need to unblock the file using theUnblock-Filecmdlet. Unzip the contents to the location of your choice and runpwsh.exe from there. Unlikeinstalling the MSI packages, installing the ZIP archive doesn't check for prerequisites. Forremoting over WSMan to work properly, ensure that you've met theprerequisites.

Use this method to install the ARM-based version of PowerShell on computers like the MicrosoftSurface Pro X. For best results, install PowerShell to the to$Env:ProgramFiles\PowerShell\7folder.

Install as a .NET Global tool

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

dotnet tool install --global PowerShell

The dotnet tool installer adds$HOME\.dotnet\tools to your$Env:PATH environment variable.However, the currently running shell doesn't have the updated$Env:PATH. You can start PowerShellfrom a new shell by typingpwsh.

Installing from the Microsoft Store

PowerShell can be installed from the Microsoft Store. You can find the PowerShell release in theMicrosoft Store site or in the Store application in Windows.

Benefits of the Microsoft Store package:

  • Automatic updates built right into Windows
  • Integrates with other software distribution mechanisms like Intune and Configuration Manager
  • Can install on Windows systems using x86, x64, or Arm64 processors

Known limitations

By default, Windows Store packages run in an application sandbox that virtualizes access to somefilesystem and registry locations. Changes to virtualized file and registry locations don't persistoutside of the application sandbox.

This sandbox blocks all changes to the application's root folder. Any system-level configurationsettings stored in$PSHOME can't be modified. This includes the WSMAN configuration. This preventsremote sessions from connecting to Store-based installs of PowerShell. User-level configurations andSSH remoting are supported.

The following commands need write to$PSHOME. These commands aren't supported in a Microsoft Storeinstance of PowerShell.

  • Register-PSSessionConfiguration
  • Update-Help -Scope AllUsers
  • Enable-ExperimentalFeature -Scope AllUsers
  • Set-ExecutionPolicy -Scope LocalMachine

For more information, seeUnderstanding how packaged desktop apps run on Windows.

Beginning in PowerShell 7.2, the PowerShell package is now exempt from file and registryvirtualization. Changes to virtualized file and registry locations now persist outside of theapplication sandbox. However, changes to the application's root folder are still blocked.

Important

You must be running on Windows build 1903 or higher for this exemption to work.

Installing a preview version

Preview releases of PowerShell 7 install to$Env:ProgramFiles\PowerShell\7-preview so they can berun side-by-side with non-preview releases of PowerShell. PowerShell 7.6 is the next previewrelease.

Upgrading an existing installation

For best results when upgrading, you should use the same install method you used when you firstinstalled PowerShell. If you aren't sure how PowerShell was installed, you can check the value ofthe$PSHOME variable, which always points to the directory containing PowerShell that the currentsession is running.

  • If the value is$HOME\.dotnet\tools, PowerShell was installed with the.NET Global tool.
  • If the value is$Env:ProgramFiles\PowerShell\7, PowerShell was installed as anMSI package or withWinGet on a computer with an X86 or x64 processor.
  • If the value starts with$Env:ProgramFiles\WindowsApps\, PowerShell was installed as aMicrosoft Store package or withWinGet on computer with an ARM processor.
  • If the value is anything else, it's likely that PowerShell was installed as aZIP package.

If you installed via the MSI package, that information also appears in thePrograms and Features Control Panel.

To determine whether PowerShell may be upgraded with WinGet, run the following command:

winget list --id Microsoft.PowerShell --upgrade-available

If there is an available upgrade, the output indicates the latest available version. Use thefollowing command to upgrade PowerShell using WinGet:

winget upgrade --id Microsoft.PowerShell

Deploying on Windows 10 IoT Enterprise

Windows 10 IoT Enterprise comes with Windows PowerShell, which we can use to deploy PowerShell 7.

# Replace the placeholder information for the following variables:$deviceip = '<device ip address'$zipfile = 'PowerShell-7.5.2-win-arm64.zip'$downloadfolder = 'U:\Users\Administrator\Downloads'  # The download location is local to the device.    # There should be enough  space for the zip file and the unzipped contents.# Create PowerShell session to target deviceSet-Item -Path WSMan:\localhost\Client\TrustedHosts $deviceip$S = New-PSSession -ComputerName $deviceIp -Credential Administrator# Copy the ZIP package to the deviceCopy-Item $zipfile -Destination $downloadfolder -ToSession $S#Connect to the device and expand the archiveEnter-PSSession $SSet-Location U:\Users\Administrator\DownloadsExpand-Archive .\PowerShell-7.5.2-win-arm64.zip# Set up remoting to PowerShell 7Set-Location .\PowerShell-7.5.2-win-arm64# Be sure to use the -PowerShellHome parameter otherwise it tries to create a new# endpoint with Windows PowerShell 5.1.\Install-PowerShellRemoting.ps1 -PowerShellHome .

When you set up PowerShell Remoting you get an error message and are disconnected from the device.PowerShell has to restart WinRM. Now you can connect to PowerShell 7 endpoint on device.

# Be sure to use the -Configuration parameter. If you omit it, you connect to Windows PowerShell 5.1Enter-PSSession -ComputerName $deviceIp -Credential Administrator -Configuration PowerShell.7.5.2

Deploying on Windows 10 IoT Core

Windows 10 IoT Core adds Windows PowerShell when you includeIOT_POWERSHELL feature, which we canuse to deploy PowerShell 7. The steps defined above for Windows 10 IoT Enterprise can be followedfor IoT Core as well.

For adding the latest PowerShell in the shipping image, useImport-PSCoreRelease command toinclude the package in the workarea and addOPENSRC_POWERSHELL feature to your image.

Note

For ARM64 architecture, Windows PowerShell isn't added when you includeIOT_POWERSHELL. So thezip based install doesn't work. You need to useImport-PSCoreRelease command to add it inthe image.

Deploying on Nano Server

These instructions assume that the Nano Server is a "headless" OS that has a version of PowerShellalready running on it. For more information, see theNano Server Image Builderdocumentation.

PowerShell binaries can be deployed using two different methods.

  1. Offline - Mount the Nano Server VHD and unzip the contents of the zip file to your chosenlocation within the mounted image.
  2. Online - Transfer the zip file over a PowerShell Session and unzip it in your chosen location.

In both cases, you need theWindows x64 ZIP release package. Run the commands within an"Administrator" instance of PowerShell.

Offline Deployment of PowerShell

  1. Use your favorite zip utility to unzip the package to a directory within the mounted Nano Serverimage.
  2. Unmount the image and boot it.
  3. Connect to the built-in instance of Windows PowerShell.

Online Deployment of PowerShell

Deploy PowerShell to Nano Server using the following steps.

# Replace the placeholder information for the following variables:$ipaddr = '<Nano Server IP address>'$credential = Get-Credential # <An Administrator account on the system>$zipfile = 'PowerShell-7.5.2-win-x64.zip'# Connect to the built-in instance of Windows PowerShell$session = New-PSSession -ComputerName $ipaddr -Credential $credential# Copy the file to the Nano Server instanceCopy-Item $zipfile C:\ -ToSession $session# Enter the interactive remote sessionEnter-PSSession $session# Extract the ZIP fileExpand-Archive -Path C:\PowerShell-7.5.2-win-x64.zip -DestinationPath 'C:\Program Files\PowerShell 7'

PowerShell remoting

PowerShell supports the PowerShell Remoting Protocol (PSRP) over both WSMan and SSH. For moreinformation, see:

Supported versions of Windows

Microsoft supports PowerShell untilPowerShell reaches end-of-support or the version ofWindows reaches end-of-support.

The Docker images for the .NET SDK contain the latest versions of PowerShell. These images areavailable from theMicrosoft Artifact Registry.

These images may not have the latest security updates. Microsoft recommends that you update the OSpackages to the latest version to ensure the latest security updates are applied.

These images are provided for testing purposes. If you need a Docker image for a productionworkload, you should build and maintain your own.

Note

Support for a specific version of Windows is determined by the Microsoft Support Lifecyclepolicies. For more information, see:

You can check the version that you are using by runningwinver.exe.

Installation support

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

Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, seeour contributor guide.

Feedback

Was this page helpful?

YesNo

In this article

Was this page helpful?

YesNo