To install PowerShell on Windows Full SKU (works on Windows 7 SP1 and later), download either the MSI from AppVeyor for a nightly build,
or a released package from our GitHub releases page. The MSI file looks like this - PowerShell-6.0.0.<buildversion>.<os-arch>.msi
Once downloaded, double-click the installer and follow the prompts.
There is a shortcut placed in the Start Menu upon installation.
- By default the package is installed to
$env:ProgramFiles\PowerShell\
- You can launch PowerShell via the Start Menu or
$env:ProgramFiles\PowerShell\powershell.exe
- Install the Universal C Runtime on Windows versions prior to Windows 10. It is available via direct download or Windows Update. Fully patched (including optional packages), supported systems will already have this installed.
- Install the Visual C++ Redistributable for VS2015.
These instructions assume that Windows PowerShell is running on the Nano Server image and that it has been generated by the Nano Server Image Builder. Nano Server is a "headless" OS and deployment of PowerShell Core binaries can happen in two different ways:
- 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.
In both cases, you will need the Windows 10 x64 Zip release package and will need to run the commands within an "Administrator" PowerShell instance.
- 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 inbox instance of Windows PowerShell.
- Follow the instructions to create a remoting endpoint using the another instance technique.
The following steps will guide you through the deployment of PowerShell Core to a running instance of Nano Server and the configuration of its remote endpoint.
- Connect to the inbox instance of Windows PowerShell
$session = New-PSSession -ComputerName <Nano Server IP address> -Credential <An Administrator account on the system>
- Copy the file to the Nano Server instance
Copy-Item <local PS Core download location>\powershell-<version>-win10-win2016-x64.zip c:\ -ToSession $session
- Enter the session
Enter-PSSession $session
- Extract the Zip file
# Insert the appropriate version.
Expand-Archive -Path C:\powershell-<version>-win10-win2016-x64.zip -DestinationPath "C:\PowerShellCore_<version>"
- Follow the instructions to create a remoting endpoint using the another instance technique.
Beginning with 6.0.0-alpha.9, the PowerShell package for Windows includes a WinRM plug-in (pwrshplugin.dll) and an installation script (Install-PowerShellRemoting.ps1). These files enable PowerShell to accept incoming PowerShell remote connections when its endpoint is specified.
An installation of PowerShell can establish PowerShell sessions to remote computers using New-PSSession
and Enter-PSSession
.
To enable it to accept incoming PowerShell remote connections, the user must create a WinRM remoting endpoint.
This is an explicit opt-in scenario where the user runs Install-PowerShellRemoting.ps1 to create the WinRM endpoint.
The installation script is a short-term solution until we add additional functionality to Enable-PSRemoting
to perform the same action.
For more details, please see issue #1193.
The script
- Creates a directory for the plug-in within %windir%\System32\PowerShell
- Copies pwrshplugin.dll to that location
- Generates a configuration file
- Registers that plug-in with WinRM
The script must be executed within an Administrator-level PowerShell session and runs in two modes.
Install-PowerShellRemoting.ps1
<path to powershell>\Install-PowerShellRemoting.ps1 -PowerShellHome "<absolute path to the instance's $PSHOME>" -PowerShellVersion "<the powershell version tag>"
For Example:
C:\Program Files\PowerShell\6.0.0.9\Install-PowerShellRemoting.ps1 -PowerShellHome "C:\Program Files\PowerShell\6.0.0.9\" -PowerShellVersion "6.0.0-alpha.9"
NOTE: The remoting registration script will restart WinRM, so all existing PSRP sessions will terminate immediately after the script is run. If run during a remote session, this will terminate the connection.
Create a PowerShell session to the new PowerShell endpoint by specifying -ConfigurationName "some endpoint name"
. To connect to the PowerShell instance from the example above, use either:
New-PSSession ... -ConfigurationName "powershell.6.0.0-alpha.9"
Enter-PSSession ... -ConfigurationName "powershell.6.0.0-alpha.9"
Note that New-PSSession
and Enter-PSSession
invocations that do not specify -ConfigurationName
will target the default PowerShell endpoint, microsoft.powershell
.
We publish an archive with CoreCLR bits on every CI build with AppVeyor.
- Download zip package from artifacts tab of the particular build.
- Unblock zip file: right-click in File Explorer -> Properties -> check 'Unblock' box -> apply
- Extract zip file to
bin
directory ./bin/powershell.exe