Skip to content

Instantly share code, notes, and snippets.

@PixelRobots
Created February 22, 2018 12:55
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save PixelRobots/3c34027d225c7acb09833840b7258ee9 to your computer and use it in GitHub Desktop.
Install-Module AzureRm.AvailabilitySetManagement
Add-AzureRmAccount
Select-AzureRmSubscription -SubscriptionID "your subscription ID"
Get-Command -Module AzureRm.AvailabilitySetManagement
New-AzureRmAvailabilitySet -Location "East US 2" -Name "myAvailabilitySet" -ResourceGroupName "PixelRobots" -Sku aligned -PlatformFaultDomainCount 2 -PlatformUpdateDomainCount 2
Add-AzureRmAvSetVmToAvailabilitySet -ResourceGroupName "PixelRobots" -VMName "VM1" -OsType windows -AvailabilitySet "myAvailabilitySet"
Get-AzureRmAvailabilitySet -ResourceGroupName "PixelRobots" -Name "myAvailabilitySet"
Remove-AzureRmAvSetVmFromAvailabilitySet -ResourceGroupName "PixelRobots" -VMName vm1 -OsType windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment