Silver Light and Blue Sky

C# and Infrastructure. Code is everything.

Azure PowerShell preview on Linux

PowerShell is now open sourced and can run on Linux.

Azure PowerShell depends on full .NET Framework, so it can't run on Linux now.

However, preview version for .NET Core is released and I tried it.

At first, install powershell on Linux. I use Red Hat Enterprise Linux 7.2, so I use CentOS rpm.

Please replace the version as you like.

# wget
# yum localinstall powershell-6.0.0_alpha.9-1.el7.centos.x86_64.rpm

Next, confirm the PSModulePath. I use the one for user directory.

$ powershell
PS /home/user1> $env:PSMODULEPATH                                                                                           

Then, install the package.

PS /home/user1> Install-Package -Name AzureRM.NetCore.Preview -Source -ProviderName NuGet -ExcludeVersion -Destination /home/user1/.local/share/powershell/Modules   
PS /home/user1> Import-Module AzureRM.NetCore.Preview
PS /home/user1> Login-AzureRMAccount
VERBOSE: To sign in, use a web browser to open the page Enter the code AAAAAAAAA to authenticate.

You can use Azure PowerShell on Linux now!