Finally it is here--PowerShell for Linux and Mac

Published: Automation General

The most awaited feature is finally here. Never thought I would see Microsoft saying they love Linux and open source. But I suppose this was on the cards cause you can not ignore a vast population of IT landscape. So finally PowerShell is here for Linux and Mac environment.Here is a step by step guide on how you would install the Alpha release on your Mac.

To download the package visit the GitHub Repository. In current version it is available for the following platforms:

  • Windows 10 / Server 2016
  • Windows 8.1 / Server 2012 R2
  • Ubuntu 16.04
  • Ubuntu 14.04
  • CentOS 7
  • OSX 10.11

Please grab the version that is applicable to you. For me and this blogpost I selected OSX 10.11.

Once downloaded, simply double click on the powershell-6.0.0-alpha.9.pkg file to start the installation.

Start the installation

Next Select a destination drive where you want to do the installation

Select Destination Drive

Next select the installation Location

Select installation location

Next provide your credentials to allow the installation

Provide credential

 

 

Installation starts. Once the installation completes, close the window and you are good to go.

Close the window

You are all set to explore the awesomeness of PowerShell in Mac. Open a Terminal Window and type "powershell" to start the magic.

Start the session from Terminal

Notice the version, it is 6.0.0. As of now the total available commands are 345.

Note the PATH for your reference:

  • $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 atMicrosoft.PowerShell_profile.ps1 in the same locations.

On Linux and OS X, the XDG Base Directory Specification is respected.
Note that because OS X is a derivation of BSD, instead of /opt, the prefix used is /usr/local. Thus, $PSHOME is/usr/local/microsoft/powershell/6.0.0-alpha.9/, and the symlink is placed at /usr/local/bin/powershell.

** Source: https://github.com/PowerShell/PowerShell/blob/master/docs/installation/linux.md#os-x-1011

I hope we get PowerCLI plugin for Mac and Linux environment very soon :)

So till then go ahead start playing!!!!