Run PowerShell on Mac OS X

As you have probably heard by now, Microsoft has just open-sourced PowerShell and made it available for Linux and Mac OS X. In this blog post, I will take you through the steps to download, install and run PowerShell on a Mac.

Download and Install PowerShell for Mac OX

  1. Go to PowerShell github project: https://github.com/PowerShell/PowerShell
  2. Scroll down to the Get PowerShell section and download .pkg:

Download OS X pkg file for PowerShell

3. Locate the newly downloaded file in Downloads, right-click it and click Open:

Install PowerShell pkg on Mac OS X

4. You will be warned that this is a file from the Internet and then prompted for your local administrative password, then go through the installation wizard.

Run PowerShell on Mac OS X

PowerShell is a command-prompt in your terminal window, so to start it:

  1. Start the Terminal application,
  2. Now you can simply type powershell as a command and this will start the PowerShell engine and move you from the bash prompt ($) to the PowerShell prompt (PS):
    Starting PowerShell prompt on Mac OS X in bash Terminal

  3. That is it! You can now type a PowerShell command and see the output. For example, here’s Get-Process:
    Get-Process powershell command on Mac OS X

If you are new to PowerShell, see the Learning PowerShell page on GitHub.

5 Responses to “Run PowerShell on Mac OS X”


  1. 1 Patrick Minze August 19, 2016 at 6:29 pm

    Can you install the AzureRM cmdlets?

  2. 2 Patrick Minze August 19, 2016 at 6:31 pm

    Can you install AzureRM cmdlets, or is just the standard out of the box Powershell?

    • 3 Dmitry Sotnikov August 20, 2016 at 6:32 am

      Well, on the first attempt it didn’t work for me:

      PS /usr> Install-Module AzureRM                                                 
      PackageManagement\Install-Package : Unable to find module providers 
      (PowerShellGet).
      At /usr/local/microsoft/powershell/6.0.0-alpha.9/Modules/PowerShellGet/PSModule
      .psm1:1706 char:21
      + ...          $null = PackageManagement\Install-Package @PSBoundParameters
      +                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidArgument: (Microsoft.Power....InstallPack 
         age:InstallPackage) [Install-Package], Exception
          + FullyQualifiedErrorId : UnknownProviders,Microsoft.PowerShell.PackageMan 
         agement.Cmdlets.InstallPackage
      

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




My Recent Tweets

Legal

The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer - WSO2 or anyone else for that matter. All trademarks acknowledged.

© 2007-2014 Dmitry Sotnikov

August 2016
M T W T F S S
« Jan    
1234567
891011121314
15161718192021
22232425262728
293031  

%d bloggers like this: