Skip to content

Instantly share code, notes, and snippets.

@mlapida
Created December 30, 2014 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlapida/610fdc9c4ebcd197b9fc to your computer and use it in GitHub Desktop.
Save mlapida/610fdc9c4ebcd197b9fc to your computer and use it in GitHub Desktop.
Azure: VM Export to XML
$subscription = "[Subscription here]"
Select-AzureSubscription -SubscriptionName $subscription
$cloudservice = '[Cloud Service Here]'
Get-AzureVM -ServiceName $cloudservice | foreach {
$path = 'c:\vms' + $_.Name + '.xml'
Export-AzureVM -ServiceName $cloudservice -Name $_.Name -Path $path
}
# Faster way of removing all VMs while keeping the cloud service/DNS name
#Remove-AzureDeployment -ServiceName $cloudservice -Slot Production -Force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment