curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
# Register the Microsoft Ubuntu repository
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
# Update the list of products
sudo apt-get update
# Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell
pwsh
Once installed, start from the console with the pwsh command .
PowerShell Core on Ubuntu 16.0 4
Unfortunately, for PowerShell Core to work on many OSs, Microsoft has to give up quite a bit of technology.
To switch to .NET Core and other OSs, we are forced to abandon some of the technologies being used on Windows PowerShell. We take advantage of PowerShell refactor to stop supporting some of the less-used technologies. Some will return to PowerShell Core but many of them are not. At a high level, there are:
- PowerShell Workflows
- PowerShell Snap-ins
- WMIv1 cmdlets (Get-WmiObject, Invoke-WmiMethod .) Encourage using CIM / WMIv2 cmdlets (Get-CimInstance, Invoke-CimMethod .)
- The Desired State Configuration (DSC) Executing resources use PowerShell Core
We also have many minor language changes, the engine and PowerShell cmdlets, which can technically be considered breakthroughs. For more information, please read Breaking Change at: https://github.com/PowerShell/PowerShell/blob/master/docs/BREAKINGCHANGES.md.
These changes will prevent existing PowerShell scripts from working on the Core without modification.
See more: