Powershell on Mac and Connect to Azure

Powershell can be installed on Mac OS by using below command

brew cask install powershell

or by downloading package directly from github release .

https://github.com/PowerShell/PowerShell/releases

You may installed version in below folder

verify that your install is working properly:

pwsh

Note for performing remote operations Openssl ,Xcode Command line tools and .NET SDK need be installed.OpenSSL is needed for PowerShell remoting and CIM operations. .Net SDK can be installed from below command .

dotnet tool install --global PowerShell

Xcode command line tools can be installed from below command .

sudo mkdir -p /usr/local/opt/openssl
sudo ln -s /opt/local/lib/openssl-1.0 /usr/local/opt/openssl/lib

Azure Connectivity – Make sure Azure AZ and AzureRM modules are installed to connect Azure account powershell.

Install-Module -Name Az
Install-Module -Name AzureRM -AllowClobber

Check login connectivity :

Connect-AzureRmAccount

If .Net SDK is not installed you might get below errors.

If successfully installed you may see below message.

Reference links:

https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-macos?view=powershell-7

https://docs.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-4.1.0

https://github.com/Azure/azure-powershell/wiki/Troubleshooting-Module-Version-Incompatibilities-With-Azure-PowerShell

https://github.com/Azure/azure-powershell/blob/master/documentation/troubleshoot-module-load.md#symptom-cannot-load-az-modules-in-windows-powershell

Leave a Reply

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