# Ensure you have AzureRm.Compute module is installed
# To view installed modules
Get-Module
# To list all modules
#Get-Module -ListAvailable
# If AzureRmCompute is not installed, go ahead and install it
#Install-Module AzureRM.Compute
# Create an availability set
$availset = New-AzureRmAvailabilitySet -ResourceGroupName "{ResourceGroupName}" -Name "{AvailabilitySetName}" -Location "{Location}"
# If you are using managed disks for your VM use the managed switch
#$availset = New-AzureRmAvailabilitySet -ResourceGroupName "{ResourceGroupName}" -Name "{AvailabilitySetName}" -Location "{Location}" -managed
|