问题
How can I use Powershell to shutdown a Virtual Machine created using the Azure Preview Portal when there is no Cloud Service Name? i.e. what do I put for the ServiceName parameter...
Thanks!
回答1:
If it's a vm created using the resource manager api (and I guess it is if it doesn't have a cloud service), you need to switch to the resource manager mode in Powershell and access your vms from there:
Switch-AzureMode -Name AzureResourceManager
$vms = Get-AzureVM
来源:https://stackoverflow.com/questions/31877135/using-powershell-to-shutdown-vm-created-using-preview-portal-with-no-cloud-serv