Created
December 30, 2014 16:10
-
-
Save mlapida/610fdc9c4ebcd197b9fc to your computer and use it in GitHub Desktop.
Azure: VM Export to XML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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