How To Install PowerShell On Linux Ubuntu

Yesterday (19/08/16) Microsoft announced that PowerShell is open sourced and is available on Linux Ubuntu, Centos, Red Hat and Mac OS X

This Is a major news from Microsoft and I decided to try it and show you how you could run PowerShell In Linux In less than 5 minutes using the Alpha build.

Using my Azure subscription I created a Linux Virtual Machine on Microsoft Azure running Ubuntu 16.4

Once Azure created the machine I connected to it using SSH

Installing PowerShell on Linux Is a two steps process, First you need to download the Install file and then Install the package.

To download the PowerShell for Linux I use the code below

wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.9/powershell_6.0.0-alpha.9-1ubuntu1.16.04.1_amd64.deb

Once the package Is downloaded I run the command below to start the Install

sudo apt-get install libunwind8 libicu55

To finish the Installation I run the 2nd command below

sudo dpkg -i powershell_6.0.0-alpha.9-1ubuntu1.16.04.1_amd64.deb

Once done I start PowerShell on my Linux host by typing:

Powershell

Then I can run any PowerShell command like:

Get-date

To see all running processes I type:

Get-process

To view all available PowerShell commands I type:

Get-command

In total there are 354 PowerShell command available In the alpha release


Posted

in

, ,

by

Comments

One response to “How To Install PowerShell On Linux Ubuntu”

  1. Nagarjuna D N Avatar
    Nagarjuna D N

    Excellent! worked like a charm 🙂