|
| 1 | +--- |
| 2 | +description: How to install PowerShell on Windows IoT and Nano Server. |
| 3 | +ms.date: 11/19/2025 |
| 4 | +title: Install PowerShell on Windows IoT and Nano Server |
| 5 | +--- |
| 6 | +# Install PowerShell on Windows IoT and Nano Server |
| 7 | + |
| 8 | +This article describes how to install PowerShell on Windows IoT and Nano Server. |
| 9 | + |
| 10 | +## Deploy on Windows 11 IoT |
| 11 | + |
| 12 | +Windows 11 IoT Enterprise comes with Windows PowerShell, which is used to deploy PowerShell 7. |
| 13 | + |
| 14 | +```powershell |
| 15 | +# Replace the placeholder information for the following variables: |
| 16 | +$deviceip = '<device ip address>' |
| 17 | +$zipfile = 'PowerShell-7.5.4-win-arm64.zip' |
| 18 | +$downloadfolder = 'U:\Users\Administrator\Downloads' |
| 19 | +# The download location is local to the device. |
| 20 | +# There should be enough space for the zip file and the unzipped contents. |
| 21 | +
|
| 22 | +# Create PowerShell session to target device |
| 23 | +Set-Item -Path WSMan:\localhost\Client\TrustedHosts $deviceip |
| 24 | +$S = New-PSSession -ComputerName $deviceIp -Credential Administrator |
| 25 | +# Copy the ZIP package to the device |
| 26 | +Copy-Item $zipfile -Destination $downloadfolder -ToSession $S |
| 27 | +
|
| 28 | +#Connect to the device and expand the archive |
| 29 | +Enter-PSSession $S |
| 30 | +Set-Location U:\Users\Administrator\Downloads |
| 31 | +Expand-Archive .\PowerShell-7.5.4-win-arm64.zip |
| 32 | +
|
| 33 | +# Set up remoting to PowerShell 7 |
| 34 | +Set-Location .\PowerShell-7.5.4-win-arm64 |
| 35 | +# Be sure to use the -PowerShellHome parameter otherwise it tries to create a new |
| 36 | +# endpoint with Windows PowerShell 5.1 |
| 37 | +.\Install-PowerShellRemoting.ps1 -PowerShellHome . |
| 38 | +``` |
| 39 | + |
| 40 | +When you set up PowerShell Remoting you get an error message and are disconnected from the device. |
| 41 | +PowerShell has to restart WinRM. Now you can connect to PowerShell 7 endpoint on device. |
| 42 | + |
| 43 | +```powershell |
| 44 | +
|
| 45 | +# Be sure to use the -Configuration parameter. If you omit it, you connect to Windows PowerShell 5.1 |
| 46 | +Enter-PSSession -ComputerName $deviceIp -Credential Administrator -Configuration PowerShell.7.5.4 |
| 47 | +``` |
| 48 | + |
| 49 | +Windows 11 IoT Core adds Windows PowerShell when you include _IOT_POWERSHELL_ feature. Use Windows |
| 50 | +PowerShell to deploy PowerShell 7 using the same steps as Windows 11 IoT Enterprise. |
| 51 | + |
| 52 | +To add the latest PowerShell in the shipping image, use the [Import-PSCoreRelease][02] command to |
| 53 | +include the package in the workarea and add the _OPENSRC_POWERSHELL_ feature to your image. |
| 54 | + |
| 55 | +> [!NOTE] |
| 56 | +> For ARM64 architecture, Windows PowerShell isn't added when you include _IOT_POWERSHELL_. So the |
| 57 | +> zip based install doesn't work. You need to use `Import-PSCoreRelease` command to add it in |
| 58 | +> the image. |
| 59 | +
|
| 60 | +## Deploying on Nano Server |
| 61 | + |
| 62 | +These instructions assume that the Nano Server is a "headless" OS that has a version of PowerShell |
| 63 | +already running on it. For more information, see the [Nano Server Image Builder][01] |
| 64 | +documentation. |
| 65 | + |
| 66 | +PowerShell binaries can be deployed using two different methods. |
| 67 | + |
| 68 | +1. Offline - Mount the Nano Server VHD and unzip the contents of the zip file to your chosen |
| 69 | + location within the mounted image. |
| 70 | +1. Online - Transfer the zip file over a PowerShell Session and unzip it in your chosen location. |
| 71 | + |
| 72 | +In both cases, you need the [Windows x64 ZIP release package][03]. Run the commands within an |
| 73 | +"Administrator" instance of PowerShell. |
| 74 | + |
| 75 | +### Offline Deployment of PowerShell |
| 76 | + |
| 77 | +1. Use your favorite zip utility to unzip the package to a directory within the mounted Nano Server |
| 78 | + image. |
| 79 | +1. Unmount the image and boot it. |
| 80 | +1. Connect to the built-in instance of Windows PowerShell. |
| 81 | + |
| 82 | +### Online Deployment of PowerShell |
| 83 | + |
| 84 | +Deploy PowerShell to Nano Server using the following steps. |
| 85 | + |
| 86 | +```powershell |
| 87 | +# Replace the placeholder information for the following variables: |
| 88 | +$ipaddr = '<Nano Server IP address>' |
| 89 | +$credential = Get-Credential # <An Administrator account on the system> |
| 90 | +$zipfile = 'PowerShell-7.5.4-win-x64.zip' |
| 91 | +# Connect to the built-in instance of Windows PowerShell |
| 92 | +$session = New-PSSession -ComputerName $ipaddr -Credential $credential |
| 93 | +# Copy the file to the Nano Server instance |
| 94 | +Copy-Item $zipfile C:\ -ToSession $session |
| 95 | +# Enter the interactive remote session |
| 96 | +Enter-PSSession $session |
| 97 | +# Extract the ZIP file |
| 98 | +Expand-Archive -Path C:\PowerShell-7.5.4-win-x64.zip -DestinationPath 'C:\Program Files\PowerShell 7' |
| 99 | +``` |
| 100 | + |
| 101 | +## Supported versions of Windows |
| 102 | + |
| 103 | +[!INCLUDE [Windows support](../../includes/windows-support.md)] |
| 104 | + |
| 105 | +You can check the version that you are using by running `winver.exe`. |
| 106 | + |
| 107 | +## Installation support |
| 108 | + |
| 109 | +Microsoft supports the installation methods in this document. There may be other third-party methods |
| 110 | +of installation available from other sources. While those tools and methods may work, Microsoft |
| 111 | +can't support those methods. |
| 112 | + |
| 113 | +[!INCLUDE [Latest version](../../includes/latest-install.md)] |
| 114 | + |
| 115 | +<!-- link references --> |
| 116 | +[01]: /windows-server/get-started/deploy-nano-server |
| 117 | +[02]: https://github.com/ms-iot/iot-adk-addonkit/blob/master/Tools/IoTCoreImaging/Docs/Import-PSCoreRelease.md#Import-PSCoreRelease |
| 118 | +[03]: https://github.com/PowerShell/PowerShell/releases/download/v7.5.4/PowerShell-7.5.4-win-x64.zip |
0 commit comments