Q: How can I use PowerShell to add a virtual machine to an Availability Set in Azure?

A: Use the Set-AzureAvailabilitySet cmdlet to add a virtual machine to an availability set; for example:

Get-AzureVM -ServiceName "savilltech101" -Name "WebSrv3" |
    Set-AzureAvailabilitySet -AvailabilitySetName "IIS" |
    Update-AzureVM

To remove, simply set the AvailabilitySetName to "".