An open-source cross-platform version of PowerShell, called PowerShell Core 6.0, has been released by Microsoft that not only runs on Windows, but runs on macOS and Linux as well. Going forward, this version is going to be the actively developed with the original PowerShell that we have been using for the past 10 years only getting security updates from now on.
Released to general availability on January 10th, packages for PowerShell Core are available for Windows 7+, Ubuntu, Redhat, Centos, macOS, Fedora, OpenSuse, and Debian. This allows system administrators to use a common administrative scripting language on all the servers they manage.
Instructions for installing PowerShell Core have been created by Microsoft for both macOS, Linux, and Windows versions. Installing PowerShell Core on Windows is as simple as downloading the installer and executing it. This will install PowerShell Core along side the existing PowerShell already installed in Windows. This way you can test and migrate existing PowerShell scripts to PowerShell Core.
To install PowerShell on Linux & macOS, Microsoft has released packages for almost all Linux distributions. For example, to install PowerShell Core in Ubuntu 16.04, you can use the following commands:
# Import the public repository GPG keys 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 PowerShell Core is installed, you can start it from a console using the pwsh command.
Unfortunately, in order to get PowerShell Core to work on different operating systems, Microsoft had to remove support for various technologies.
As part of the move to .NET Core and other operating systems,
we were forced to leave behind some technologies that were being used by Windows PowerShell.
In other cases, we took the opportunity of PowerShell being refactored to stop supporting lesser used technologies. Some of these technologies may eventually return to PowerShell Core, but many will not.
At a high-level, these include:
We’ve also made a longer tail of small changes to the PowerShell language, engine, and cmdlets that technically qualify as breaking changes.
For more information on why we made these changes/removals, see our document on Breaking Change
These changes will most likely cause existing PowerShell scripts to not work properly in Core without modifications.