Install manually via MSI or with the Chocolatey package manager.
Installing PowerShell Core using MSI
The primary way for installing PowerShell Core is to download the official MSI release from the PowerShell GitHub page. Scroll down to Get PowerShell and click the .msi link from the Downloads (stable) column for your version of Windows (either x86 or x64).
Right-click the downloaded MSI and select Install. On the Wizard Welcome screen, click Next.
Check I accept the terms in the license agreement. Click Next.
Note the default install path of C:\Program Files\PowerShell (this differs from Windows PowerShell). Click Next.
On the Optional Actions pane, note the default selections. Decide whether this system needs to have PowerShell Remoting enabled. When you have made your selections, click Next.
Click Install. The installation will proceed automatically.
When the installation completes, you’ll see the following screen. Click Finish.
Now PowerShell Core is in your Start Menu:
PowerShell Core MSI install via command line
That was a manual walk through of the installation, but as scripters we want to do that in one line! Run the following from an administrative command prompt to install with default options:
> msiexec /i PowerShell-6.1.3-win-x64.msi /qb-!
Updating MSI installation is a manual process
PowerShell Core does not currently get updated via Windows Update, so keeping the MSI installation up to date is a manual affair, revisiting the GitHub page and downloading the latest version and running an upgrade. That is less than ideal, so next we will cover how to use Chocolatey, the open source Windows package manager, to install PowerShell Core and keep it up to date.
Installing Chocolatey
If you already have Chocolatey installed you can skip this section. If not, open an administrative Windows PowerShell prompt and run the following one-liner which will download and install Chocolatey:
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Once the install completes, you can use the choco command from either a command prompt or PowerShell prompt.
Install PowerShell Core using Chocolatey
From an administrative command prompt (or administrative PowerShell prompt), run the following command to install PowerShell Core using the published community package. Append ‘-y’ to auto-accept any confirmation prompts.
choco install powershell-core -y
You will see the command line output of the install activity. Under the covers, the package is downloading and installing the latest stable release MSI from the GitHub site. It will install it in C:\Program Files\PowerShell, and it will appear in Programs and Features as an installed program. Not much different than if you had installed it manually. The advantage is handling future updates.
Update PowerShell Core using Chocolatey
NOTE: Because we are administering the PowerShell Core installation, do NOT run these commands from a PowerShell Core prompt.
To demonstrate the update experience, let’s first uninstall the latest PowerShell Core. From an administrative command prompt, run:
choco uninstall powershell-core
Now that it has been completely removed, we are going to install PowerShell Core, but specifying an older version to install.
choco install powershell-core --version 6.1.2 -y
Once the older version is installed, we can run the following command to determine if there is an update:
choco outdated
To upgrade PowerShell Core, run the following to upgrade to the latest stable version.
choco upgrade powershell-core -y
Start a PowerShell Core prompt
To start using PowerShell Core, do a Windows search for pwsh and press Enter. You can also find the PowerShell 6 icon in the Start Menu.
Type $PSVersionTable and press Enter to confirm your PowerShell Core runtime information:
PS C:\Users\Demo> $PSVersionTable
Name Value
---- -----
PSVersion 6.1.3
PSEdition Core
GitCommitId 6.1.3
OS Microsoft Windows 10.0.17763
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
PS C:\Users\Demo>
Next steps
With PowerShell Core installed, next we will cover installing and configuring the Windows Compatibility Module to enable Windows PowerShell cmdlets that haven’t yet made their way into PowerShell Core.
Leave a Reply