Windows
Last updated
Was this helpful?
Last updated
Was this helpful?
Installing from the Microsoft Store
PowerShell can be installed from the Microsoft Store. You can find the PowerShell release in the 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
By default, Windows Store packages run in an application sandbox that virtualizes access to some filesystem and registry locations. Changes to virtualized file and registry locations don't persist outside of the application sandbox.
This sandbox blocks all changes to the application's root folder. Any system-level configuration settings stored in $PSHOME
can't be modified. This includes the WSMAN configuration. This prevents remote sessions from connecting to Store-based installs of PowerShell. User-level configurations and SSH remoting are supported.
The following commands need write to $PSHOME
. These commands aren't supported in a Microsoft Store instance of PowerShell.
Register-PSSessionConfiguration
Update-Help -Scope AllUsers
Enable-ExperimentalFeature -Scope AllUsers
Set-ExecutionPolicy -Scope LocalMachine
For more information, see .
Beginning in PowerShell 7.2, the PowerShell package is now exempt from file and registry virtualization. Changes to virtualized file and registry locations now persist outside of the application sandbox. However, changes to the application's root folder are still blocked.
You must be running on Windows build 1903 or higher for this exemption to work.
Preview releases of PowerShell 7 install to $env:ProgramFiles\PowerShell\7-preview
so they can be run side-by-side with non-preview releases of PowerShell. PowerShell 7.4 is the next preview release.
For best results when upgrading, you should use the same install method you used when you first installed PowerShell. If you aren't sure how PowerShell was installed, you can check the value of the $PSHOME
variable, which always points to the directory containing PowerShell that the current session is running.
If you installed via the MSI package, that information also appears in the Programs and Features Control Panel.
To determine whether PowerShell may be upgraded with Winget, run the following command:
If there is an available upgrade, the output indicates the latest available version.
Windows 10 IoT Enterprise comes with Windows PowerShell, which we can use to deploy PowerShell 7.
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.
Windows 10 IoT Core adds Windows PowerShell when you include IOT_POWERSHELL feature, which we can use to deploy PowerShell 7. The steps defined above for Windows 10 IoT Enterprise can be followed for IoT Core as well.
PowerShell binaries can be deployed using two different methods.
Offline - Mount the Nano Server VHD and unzip the contents of the zip file to your chosen location within the mounted image.
Online - Transfer the zip file over a PowerShell Session and unzip it in your chosen location.
Use your favorite zip utility to unzip the package to a directory within the mounted Nano Server image.
Unmount the image and boot it.
Connect to the built-in instance of Windows PowerShell.
Deploy PowerShell to Nano Server using the following steps.
If the value is $HOME\.dotnet\tools
, PowerShell was installed with the .
If the value is $Env:ProgramFiles\PowerShell\7
, PowerShell was installed as an or with on a computer with an X86 or x64 processor.
If the value starts with $Env:ProgramFiles\WindowsApps\
, PowerShell was installed as a or with on computer with an ARM processor.
If the value is anything else, it's likely that PowerShell was installed as a .
For adding the latest PowerShell in the shipping image, use command to include the package in the workarea and add OPENSRC_POWERSHELL feature to your image.
These instructions assume that the Nano Server is a "headless" OS that has a version of PowerShell already running on it. For more information, see the documentation.
In both cases, you need the . Run the commands within an "Administrator" instance of PowerShell.
Follow the instructions to create a remoting endpoint using the .
If you want WSMan-based remoting, follow the instructions to create a remoting endpoint using the .