Installing PowerShell Core on Windows

MSI

To install PowerShell on a Windows client or Windows Server (works on Windows 7 SP1, Server 2008 R2, and later), download the MSI package from our GitHub releases page.

The MSI file looks like this - PowerShell-<version>-win-<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\<version>
  • You can launch PowerShell via the Start Menu or $env:ProgramFiles\PowerShell\<version>\pwsh.exe

Prerequisites

To enable PowerShell remoting over WSMan, the following prerequisites need to be met:

  • 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 Windows Management Framework (WMF) 4.0 or newer on Windows 7 and Windows Server 2008 R2.

ZIP

PowerShell binary ZIP archives are provided to enable advanced deployment scenarios. Be noted that when using the ZIP archive, you won't get the prerequisites check as in the MSI package. So in order for remoting over WSMan to work properly on Windows versions prior to Windows 10, you need to make sure the prerequisites are met.

Deploying on Windows IoT

Windows IoT already comes with Windows PowerShell which we will use to deploy PowerShell Core 6.

  1. Create PSSession to target device

    $s = New-PSSession -ComputerName <deviceIp> -Credential Administrator
    
  2. Copy the ZIP package to the device

    # change the destination to however you had partitioned it with sufficient
    # space for the zip and the unzipped contents
    # the path should be local to the device
    Copy-Item .\PowerShell-6.1.0-win-arm32.zip -Destination u:\users\administrator\Downloads -ToSession $s
    
  3. Connect to the device and expand the archive

    Enter-PSSession $s
    cd u:\users\administrator\downloads
    Expand-Archive .\PowerShell-6.1.0-win-arm32.zip
    
  4. Setup remoting to PowerShell Core 6

    cd .\PowerShell-6.1.0-win-arm32
    # Be sure to use the -PowerShellHome parameter otherwise it'll try to create a new
    # endpoint with Windows PowerShell 5.1
    .\Install-PowerShellRemoting.ps1 -PowerShellHome .
    # You'll get an error message and will be disconnected from the device because it has to restart WinRM
    
  5. Connect to PowerShell Core 6 endpoint on device

    # Be sure to use the -Configuration parameter.  If you omit it, you will connect to Windows PowerShell 5.1
    Enter-PSSession -ComputerName <deviceIp> -Credential Administrator -Configuration powershell.6.1.0
    

Deploying on Nano Server

These instructions assume that a version of PowerShell is already running on the Nano Server image and that it has been generated by the Nano Server Image Builder. Nano Server is a "headless" OS. Core binaries can be deploy using two different methods.

  1. Offline - Mount the Nano Server VHD and unzip the contents of the zip file to your chosen location 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 will need the Windows 10 x64 ZIP release package and will need to run the commands within an "Administrator" PowerShell instance.

Offline Deployment of PowerShell Core

  1. Use your favorite zip utility to unzip the package to a directory within the mounted Nano Server image.
  2. Unmount the image and boot it.
  3. Connect to the inbox instance of Windows PowerShell.
  4. Follow the instructions to create a remoting endpoint using the "another instance technique".

Online Deployment of PowerShell Core

The following steps 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>-win-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>-win-x64.zip -DestinationPath "C:\PowerShellCore_<version>"
    
  • If you want WSMan-based remoting, follow the instructions to create a remoting endpoint using the "another instance technique".

Instructions to Create a Remoting Endpoint

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

Artifact Installation Instructions

We publish an archive with CoreCLR bits on every CI build with AppVeyor.

To install PowerShell Core from the CoreCLR Artifact:

  1. Download ZIP package from artifacts tab of the particular build.
  2. Unblock ZIP file: right-click in File Explorer -> Properties -> check 'Unblock' box -> apply
  3. Extract zip file to bin directory
  4. ./bin/pwsh.exe