Azure PowerShell 1.0 changes
Learn how to use the Azure PowerShell 1 module with Azure Resource Manager.
December 11, 2015
Q. What is different in Azure PowerShell 1.0?
A. Azure PowerShell 1.0 represents a new direction for the management of Azure Resource Manager resources vs Azure Service Manager resources. Prior to 1.0 the Switch-AzureMode cmdlet was used to switch between ARM and ASM management and cmdlets with the same name were used in each mode but behaved very differently. With 1.0 the ARM cmdlets all have RM in the name, for example Get-AzureRMVM instead of Get-AzureVM. This means a switch of mode is no longer required as you specifically use the ARM cmdlets which are also in a separate module.
The new Azure PowerShell 1.0 can be downloaded from https://azure.microsoft.com/en-us/downloads/ under the Command-line tools section. Note that the pre 1.0 is still available as the legacy PowerShell library. Once installed you need to download the various modules that make up the AzureRM and Azure PowerShell environments. This can be done with the following commands from an elevated PowerShell window.
Set-ExecutionPolicy RemoteSigned #Required to install the modulesInstall-Module AzureRM #Install the Azure RM modules Install-AzureRM #Download and install each module of Azure RM Install-Module Azure $Install the ASM moduleImport-Module AzureRM #Load ARM cmdletsImport-Module Azure #Load ASM cmdlets (note you would likely only use one of these cmdlets)
To login with AzureRM use the Login-AzureRmAccount cmdlet. For ASM still use the Add-AzureAccount cmdlet.
Once logged in subscriptions can be viewed using Get-AzureRmSubscription and one selected using Select-AzureRmSubscription (same way that was done with pre 1.0 PowerShell). To get the status of all VMs in a resource group I could use:
$VMs = Get-AzureRmVM -ResourceGroupName $RG.ResourceGroupNameforeach($VM in $VMs){ Get-AzureRmVM -ResourceGroupName $RG.ResourceGroupName -Name $VM.Name -Status}
About the Author
You May Also Like