How to Install Microsoft PowerShell on Linux or OS X

how-to-install-microsoft-powershell-on-linux-or-os-x photo 1

PowerShell is now open source, and available for Linux and Mac. You can download official packages from Microsoft for the 64-bit versions of Ubuntu 16.04, Ubuntu 14.04, CentOS 7, Red Hat Enterprise Linux 7, and Mac OS X 10.11.

Download the Packages from Microsoft

Visit the PowerShell project’s Releases page on GitHub to find the packages. Download the appropriate one for your operating system:

  • Ubuntu 16.04: Download the package ending in “16.04.1_amd64.deb”.
  • Ubuntu 14.04: Download the package ending in “14.04.1_amd64.deb”.
  • CentOS 7 and Red Hat Enterprise Linux 7: Download the package ending in “el7.centos.x86_64.rpm”.
  • Mac: Download the package ending in “.pkg”.

how-to-install-microsoft-powershell-on-linux-or-os-x photo 2

How to Install PowerShell on Linux

With the package downloaded, launch a terminal window on your Linux desktop. You’ll now need to install the package’s dependencies and the package itself.

On Ubuntu 16.04, run the following commands:

sudo apt-get install libunwind8 libicu55 sudo dpkg -i /path/to/powershell.deb

So, if you downloaded the package “powershell_6.0.0-alpha.9-1ubuntu1.16.04.1_amd64.deb” to the Downloads folder in your home folder, you’d run the following commands:

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

Note that you can use tab completion to speed up this process. For example, if the file was in your Downloads folder, you’d type ~/Downloads/powershell and then press Tab. Bash will automatically complete the file name if it’s the only file that starts with “powershell” in that directory.

how-to-install-microsoft-powershell-on-linux-or-os-x photo 3

On Ubuntu 14.04, run the following commands:

sudo apt-get install libunwind8 libicu52 sudo dpkg -i /path/to/powershell.deb

On CentOS 7, run the following commands:

sudo yum install /path/to/powershell.rpm

If all goes well, PowerShell should now be installed on your system.

How to Install PowerShell on a Mac

To install PowerShell on a Mac, just double-click the downloaded .pkg file. It will launch a package installer and install PowerShell like any other application.

At the moment, the package doesn’t appear to be signed, so you’ll have to bypass Gatekeeper to install it. To do so, right-click or Ctrl-click the file .pkg, select “Open”, and agree to run the installer.

how-to-install-microsoft-powershell-on-linux-or-os-x photo 4

How to Launch PowerShell on Linux or Mac

Open a terminal and run the “powershell” command to access a PowerShell shell environment. This works on both Linux and Mac–whichever you’re using.

You’ll see a PowerShell prompt beginning with “PS”, and you can run PowerShell cmdlets just as you would on Windows.

how-to-install-microsoft-powershell-on-linux-or-os-x photo 5

To leave the PowerShell prompt, just type “exit” and press Enter or close the terminal window.

For more detailed information, visit the PowerShell project’s GitHub page. You can download the source code, report issues, and view more official documentation there.

More stories

How to Create a Shortcut to Change your DNS Server in Windows

Changing your DNS can be useful to boost your privacy, increase safety, raise Internet speed, or for any other reason, but it can be tiresome to go into the network settings every time you want to switch it out. Luckily, with a freeware utility and some know-how, you can make it as easy as

How to Avoid Junkware Offers with Unchecky

You recommend a program to a family member, and they proceed to install it along with five other junkware programs that sneak their way on to their computer in the installation process.  Sound familiar?  Unchecky prevents these unnecessary programs from installing themselves by unchecking the

Do I Need a Firewall if I Have a Router?

There are two types of firewalls: hardware firewalls and software firewalls. Your router functions as a hardware firewall, while Windows includes a software firewall. There are other third-party firewalls you can install, too.