In the previous tips, we explained how you can download and install Chocolatey, a free Windows package manager that can install software for you.
Today, we’ll look at how Chocolatey can be used to download and install PowerShell Core 6 so you can test and play with it. This installation will not change your current Windows PowerShell version, so you can safely install it side-by-side.
To install the PowerShell Core package, you do need Administrator privileges. Open a PowerShell window with full Administrator access. Do not use Chocolatey with the PowerShell ISE because the PowerShell ISE cannot display interactive console messages and prompts.
If you installed Chocolatey as a portable app, add its path to the Windows “Path” environment variable. Then run the install command:
PS> $env:path += ";C:\ProgramData\chocoportable"
PS> choco install powershell-core -y
You’ll now see a bunch of messages while Choco determines the dependencies, downloads and installs the prerequisites, and finally installs PowerShell Core 6.
After the installation is complete, PowerShell Core 6 can be found in C:\Program Files\PowerShell\[Version]\pwsh.exe.
To find out whether any of the packages you installed via Chocolatey is outdated, run this command:
PS> choco outdated
And to update an installed package, use this:
PS C:\> choco upgrade powershell-core Chocolatey v0.10.8 Upgrading the following packages: powershell-core By upgrading you accept licenses for the packages. powershell-core v6.0.2 is the latest version available based on your source(s). Chocolatey upgraded 0/1 packages. See the log for details (C:\ProgramData\chocoportable\logs\chocolatey.log). PS C:\>
ReTweet this Tip!