这创造了关闭VM不是this question重复,因为该解决方案不再有效MS做出了改变打破向后兼容性之后。使用Azure的PowerShell来,没有云服务名称
我的需求是以编程方式(通过Azure Powershell)启动/停止以编程方式创建的VM(通过Azure Powershell)。该文件说,我需要提供“服务名称”,但我无法找到我怎么能获得从一个VM任何参考:
Stop-AzureVM -ServiceName $hostname -Name $hostname
Start-AzureVM -ServiceName $hostname -Name $hostname
文档也建议使用Get-AzureService
和(我认为)让我提供配置文件而不是服务。但是,使用Select-AzureRmProfile
我只能获得Microsoft.Azure.Commands.Profile.Models.PSAzureProfile
,但Get-AzureService
需要Microsoft.Azure.Commands.Profile.Models.PSAzureSMProfile
。我被卡住了。
帮助?