Since PowerShell announced as open source it has support on Linux and Mac as well and the extended support makes below possible.
- Managing Azure using PowerShell from Linux or Mac
- Managing Linux and Windows Containers with Docker
- Native Linux Management with PowerShell
- Manage AWS using PowerShell from Linux
- Manage VMware using PowerShell from linux
Today we will look at how to install the PowerShell on Mac.
- First download the PowerShell package for mac from here
- After you download run the setup on the mac. (Make sure you allow the packages from 3rd party sources.)
- Once it is installed launch the terminal and type in PowerShell.
Then launch the below command on the PowerShell window.Install-Module AzureRM.NetCore.Preview -Scope CurrentUser
- If you don’t mention the -scopeCurrent user it will throw an error message as below. PackageManagement\Install-Package : Administrator rights are required to instal l or update. Log on to the computer with an account that has Administrator righ ts, and then try again, or install by adding “-Scope CurrentUser” to your comma nd. You can also try running the Windows PowerShell session with elevated right s (Run as Administrator). At /usr/local/microsoft/powershell/6.0.0-beta.7/Modules/PowerShellGet/126.96.36.199/P SModule.psm1:1867 char:21 + … $null = PackageManagement\Install-Package @PSBoundParameters + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (System.Collections.ArrayList:S tring) [Install-Package], Exception + FullyQualifiedErrorId : AdministratorRightsNeededOrSpecifyCurrentUserSco pe,Copy-Module,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
- After the installation is complete Download the Dot Net core SDK for Mac from this link and complete the setup.
- Following the successful dot net setup run the below command to verify the AzureRm PowerShell is functional.
- Then enter Login-AzureRMAccount to connect to your Azure portal.
- Open your browser and enter the url “https://aka.ms/devvicelogin” and enter the code shown above to authenticate with the portal.
- Once its successfully authenticated you will see on the browser as below and on the terminal you will see the portal details.
- From here you can launch your AzureRM PowerShell commands and manage your portal.
I hope it was informative . Let me know your feedback on this by commenting below!