search
top

Microsoft Releases PowerShell for Linux and OSX

Alright, I hear the comments now from the Linux guys, me included. PowerShell on Linux? Well yes, Microsoft has released PowerShell for Linux and OS X. It is available here https://github.com/PowerShell/PowerShell. Feeling a bit adventurous? Go ahead and download the Alpha and start playing.

Here are the Installation instructions as per Microsoft.

Currently supports Ubuntu 14.04, Ubuntu 16.04, CentOS 7, and OS X 10.11.

Ubuntu 14.04

Download the latest Debian package from the releases page onto the Ubuntu machine. At current writing it is powershell_6.0.0-alpha.9-1ubuntu1.14.04.1_amd64.deb.

Open a terminal session:

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

Ubuntu 16.04

Download the latest Debian package from the releases page onto the Ubuntu machine. At current writing it is powershell_6.0.0-alpha.9-1ubuntu1.16.04.1_amd64.deb.

Open a terminal session:

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

CentOS 7

Download the latest RPM package from the releases page onto the CentOS machine. At current writing it is powershell_6.0.0-alpha.9-1.el7.centos.x86_64.rpm.

$ sudo yum install powershell-6.0.0_alpha.9-1.el7.centos.x86_64.rpm

This package should work on Red Hat Enterprise Linux 7 too.
OS X 10.11

Download the PKG package from the releases page onto the OS X machine. At current writing it is powershell-6.0.0-alpha.9.pkg.

Double-click the file and follow the prompts, or install it from the terminal using the following command.

$ sudo installer -pkg powershell-6.0.0-alpha.9.pkg -target /

Here are the Path details according to Microsoft.

$PSHOME is /opt/microsoft/powershell/6.0.0-alpha.9/
User profiles will be read from ~/.config/powershell/profile.ps1
Default profiles will be read from $PSHOME/profile.ps1
User modules will be read from ~/.local/share/powershell/Modules
Shared modules will be read from /usr/local/share/powershell/Modules
Default modules will be read from $PSHOME/Modules
PSReadLine history will be recorded to ~/.local/share/powershell/PSReadLine/ConsoleHost_history.txt

The profiles respect PowerShell’s per-host configuration, so the default host-specific profiles exists at Microsoft.PowerShell_profile.ps1 in the same locations.

Note that because OS X is a derivation of BSD, instead of /opt, the prefix used is /usr/local. So replace /opt with /usr/local from the output above.

The real question is how does it look and what can you do? We’ll I took the chance and installed it on a CentOS 7 server. Here’s a bit on what we found.

Installation was simple following the steps.

ps_centos_1

To start it up type powershell.

ps_centos_2

Available modules are in the /opt/microsoft/powershell/6.0.0-alpha.9/Modules directory.

ps_centos_3

Run Get-Modules to list available Modules.

ps_centos_4

Find out what get commands are available by running the Get-Command.

ps_centos_5

Have fun exploring what is available!

 

2 Responses to “Microsoft Releases PowerShell for Linux and OSX”

  1. I noticed that you copied our installation instructions verbatim. Rather than doing this and so locking your instructions to a particular version, I’d recommend you instead link to the official instructions (https://github.com/PowerShell/PowerShell#get-powershell) so that your users can stay up-to-date.

    • newlife007 says:

      I have changed the installations to not be verbatim, sorry about that, and I have added verbiage to check for latest releases and links to the releases page. I am a big fan of PowerShell and was a bit exited. Sorry about that.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

top
Life of a Geek Admin
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.