Using Powershell to shutdown VM created using Preview Portal, with no Cloud Service Name

荒凉一梦 提交于 2020-01-06 06:53:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!