Set up Microsoft PowerShell for Apple macOS operating system

Set up PowerShell on macOS

Documentation of isLucid is made to support you. Any new thing can be confusing. What is natural for us, does not necessary is understandable for everybody else in the world. So we encourage you to ask for help, clarifications and assistance if anything is unclear

On this page, you will find quick walk-through information helping you to set up PowerShell for mac computer. During this process you will:

  1. Steps in setting up PowerShell

Setting Up PowerShell

Set up PowerShell on macOS

It is tricky. For one machine of ours, we still did not manage to run PowerShell. On Github, we found open issues on connecting to the o365 administration. But on other machines, we managed to run everything successfully. So you need to try. To start:

  1. Install the latest release version of PowerShell from Github: https://github.com/PowerShell/PowerShell/releases
  2.  Install MacPorts from Github:
    https://github.com/macports/macports-base/releases
  3. Install OpenSSL (older version) which is required by PowerShell:
    sudo port install openssl10
  4. If you have already existing symlinks for OpenSSL (this was driving us insane for some time) you need to move symlink  /usr/local/opt/openssl out of the way
  5. Make a symlink so that PowerShell would find it:
    sudo mkdir -p /usr/local/opt/openssl
    sudo ln -s /opt/local/lib/openssl-1.0 /usr/local/opt/openssl/lib
  6. Open PowerShell in terminal:
    pwsh
  7. Install Teams PowerShell in PowerShell terminal:
    Install-Module MicrosoftTeams
  8. Test connection if you can start session successfully:
    $UserCredential = Get-Credential
    Import-Module MicrosoftTeams
    $Session = New-CsOnlineSession -Credential $credential
    Import-PSSession $Session
    If you can not connect, get an error, you can try following the steps to set up PowerShell on macOS in Microsoft official documentation. Just for us, it made more problems than the steps suggested above. You can read the documentation here.
  9. Test connection to MS Teams:
    Connect-MicrosoftTeams -Credential $credential
If you have trouble logging in, it might be due to Multi-Factor Authenticator.

To log in with MFA enabled, please start and run PowerShell ISE and use the following command:

$acctName=”[email protected]” $orgName=”company.domain” Import-Module MicrosoftTeams Connect-MicrosoftTeams

Please have the device on which you confirm your login, e.g mobile phone with Microsoft Authenticator App

Still have open questions? Ask away!

    Get the latest updates mailed to you