How To Install Microsoft PowerShell On Linux And OS X


Short Bytes: Microsoft has open sourced the code of its command line shell and scripting language PowerShell, bringing this automation framework to Linux and OS X. By downloading the appropriate package from PowerShell’s GitHub page and running a couple of commands, you can easily install the application on Ubuntu, CentOS, and OS X.

Last week, for the open source lovers, another great news came from the house of Microsoft. The company made the official announcement that it’s open sourcing its command line shell and scripting language PowerShell, sharing the code for OS X and Linux distros on GitHub. For those who don’t know, PowerShell is a widely used automation framework that is build on the .NET framework.

Currently, apart from Windows operating system, PowerShell is available on Ubuntu, CentOS, RHEL, and OS X. Microsoft has also promised that this initial release will be followed by support for further distros.

Today, I’m going to tell you how to get PowerShell up and running on your Linux distro and OS X operating system.

How to install PowerShell in Linux — Ubuntu, and CentOS

To get started with the PowerShell installation process, you need to visit PowerShell’s Github page and find the appropriate package for installation. Depending upon your operating system, download the packages:

Installing PowerShell on Ubuntu 16.04:

After downloading the package ending with 16.04.1_amd64.deb, run the following commands in a Terminal window:

sudo apt-get install libunwind8 libicu55
sudo dpkg -i powershell_6.0.0-alpha.9-1ubuntu1.16.04.1_amd64.deb


Installing PowerShell on Ubuntu 14.04:

Once you have downloaded the package ending with 14.04.1_amd64.deb, run the following commands in a Terminal window:

sudo apt-get install libunwind8 libicu52
sudo dpkg -i powershell_6.0.0-alpha.9-1ubuntu1.14.04.1_amd64.deb

Installing PowerShell on CentOS 7:

Download the package ending with el7.centos.x86_64.rpm and run the following command in your Terminal:

sudo yum install /path/to/powershell.rpm

How to install PowerShell in OS X?

For installing Microsoft PowerShell on a Mac, you don’t need to run any commands in your terminal. Simply download the package ending with .pkg and double-click the file.

This will launch the installer and install the application within seconds.

How to run/launch Powershell on OS or Linux?

After successfully installing PowerShell on your Linux or OS X system, simply open Terminal and run the following command:

powershell

Here are the screenshots of my systems:


PowerShell running on Ubuntu 16.04 Xenial Xerus

PowerShell running on Mac

For leaving the PowerShell window, type “exit” command and press Enter. You can also close the terminal window to end your session.

If you are interested in grabbing the source code or getting more official documentation, visit PowerShell GitHub page.

Did you find this article helpful? Don’t forget to drop your feedback in the comments section below.

Also Read: Microsoft Open Sources “Checked C” — An Extended Version Of C 

How To Install Microsoft PowerShellHow To Install PowerShellMicrosoftMicrosoft PowerShellPowershell