running powershell on macos

2020-09-21

 | 

~1 min read

 | 

175 words

We’re predominately a Windows shop at Olo, which means that we have a number of Powershell scripts that are quite useful and robust. I use them with glee when I’m in my virtualized Windows environment to speed up my workflows. Today, however, I learned that it’s not only possible, but fully supported, to run powershell scripts on MacOS (10.12+).

  1. Install Powershell The simplest way to install is with Homebrew

    brew install powershell

    When I did this, I did need administrative privileges to complete the installation.

  2. Confirm it functions

    pwsh

    If successfully installed, this command will enter you into a new powershell session

    PowerShell 7.0.3
    Copyright (c) Microsoft Corporation. All rights reserved.
    
    https://aka.ms/powershell
    Type 'help' to get help.
    PS ~/working/directory> $

    To quit, use Ctrl+C twice or Ctrl+D

  3. Run your powershell scripts

    pwsh path/to/my/script/myPowershellScript.ps1

Suddenly, I have access to all of the scripts that my team’s written on Mac… as long as they’re platform agnostic (referencing the C:/ drive is still going to be problematic).



Hi there and thanks for reading! My name's Stephen. I live in Chicago with my wife, Kate, and dog, Finn. Want more? See about and get in touch!