Currently the Linux version of PowerShell is still alpha version, so many features are not available.
For example, through the PowerShell command: Install-module azurerm to install Azure module online. However, we can implement the installation of Azure components in a flexible way:
1. Install PowerShell as described earlier, or install it with Yum after downloading the RPM installation package:
Yum install ./powershell-6.0. 0_alpha. 9-1. el7.centos.x86_64.rpm
2. After the installation is complete, create the installation directory for the PowerShell Moudle:
mkdir -p/usr/local/share/powershell/modules
3. Enter the PowerShell environment:
PowerShell
4. Install the Azure package:
Install-package-name Azurerm.netcore.preview-source Https://www.powershellgallery.com/api/v2-ProviderName NuGet- Excludeversion-destination/usr/local/share/powershell/modules
5. Import Azure Package:
Import-module AzureRM.NetCore.Preview
You can sign in with Azure commands below, and manage Azure:
Login-azurermaccount-environmentname Azurechinacloud V Erbose:to Signinch, use a Web browser to open the page https://aka.ms/Deviceloginchina. Enter the code XXXXXXXX to authenticate.
Open your browser on your PC, access links and code, and authenticate users. The following information appears after authentication: Environment:AzureChinaCloudAccount:admin@Xxxx.partner.onmschina.cnTenantId:xxxxSubscriptionId:xxxxSubscriptionName:weiheng1Curre Ntstorageaccount:
Get Azure's ResourceGroup information via the PowerShell command:
Get-Azurermresourcegroup
Resourcegroupname:Default-NetworkingLocation:chinaeastProvisioningState:SucceededTags:ResourceId:/subscriptions/xxxx/resourcegroups/Default-networking
Installing Azure Module under CentOS 7.2 PowerShell