Azure PowerShell TOP scripts

This is a list of the most used and useful PowerShell commands I use in Microsoft Azure, I will keep this guideline updated time to time.

Install PowerShell navigating in the link below and selecting PowerShell (Specific OS) at the bottom




To install Azure PowerShell

To install Azure PowerShell and some quick fixes

Find-Module -Name AzureRM | install-module -AllowClobber

To install the AzureRM module and force all overriding

Update-Help -Force

To force an update of the AzureRM modules


Check your PowerShell version


Used to login into azure account

Set-AzureRmContext -SubscriptionName ‘mysubscription’

To switch between the subscriptions

Changing the availability group in an existing Azure VM is not currently available in the Azure Portal.


Check the script execution policy setting

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Confirm

Set the script execution policy setting

git –version

Check that git is accessible from PowerShell.
If git is not recognized as the name of a command verify that you have Git installed. If not, install Git from

Get-AzureRmVMSize -Location $locName | Select Name

Get all tiers available per reagion

Enter-PSSession -ComputerName -Credential Get-Credential

Start a remote session (Enable the WinRM in the NSG)

Get all Azure VM in All Subscriptions

Get-AzureRmVMSize -ResourceGroupName “Name” -VMName “Name”

Get Azure VM sizes


Related blog posts