In this article we get you up and running with PowerShell 6.0.1 Core preview 3, on the latest Ubuntu 18.04. This works for both Desktop or Server versions of the latest Ubuntu.
Perform the following from the terminal or an SSH session to the host:
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - sudo curl -o /etc/apt/sources.list.d/microsoft.list https://packages.microsoft.com/config/ubuntu/18.04/prod.list sudo apt-get update sudo apt-get install -y powershell-preview
If you do not have curl you can install it with
sudo apt -y install curland then try the above again.
Launch PowerShell preview
pwsh-preview is the new way to launch preview versions of PowerShell Core. Previously it was simply
pwsh, but that is now reserved for stable releases.
exit to leave your PowerShell session. This returns you to the terminal prompt. Try launching more PowerShell prompts from within a PowerShell prompt so you can get familiar with the look of the terminal compared to PowerShell.
You can do this anytime to update the PowerShell help.
Optionally, create a PowerShell $PROFILE. This allows us to customize how PowerShell starts up (i.e. modules to load, directory to start in, etc.).
Here we add a line to our
$PROFILE that stops the beeping sound that PowerShell makes.
Add-Content -Value "Set-PSReadlineOption -BellStyle None" -Path $PROFILE
Reload your PowerShell $PROFILE, or exit
There is a shortcut to reload the PowerShell $PROFILE:
View $PROFILE Contents
Install PowerCLI (optional)
If you are a VMware vSphere user, you may want the
VMware.PowerCLI module. This works perfectly.
Install-Module VMware.PowerCLI -Scope CurrentUser
In this quick article we installed and launched the latest PowerShell 6.0.1 Core preview 3 on Ubuntu 18.04.
For the installation we follow the official Microsoft documentation, except for the launching of PowerShell preview, which we do with
pwsh-preview, instead of