【发布时间】:2016-06-07 10:57:27
【问题描述】:
以下脚本运行了一段时间,不知道为什么我不断收到此错误:
Select-AzureSubscription :带有 MSDN 的订阅名称 Visual Studio Ultimate 不存在。 参数名称:名称
...等等..
Get-AzureVM:未指定默认订阅。使用 Select-AzureSubscription -Default 来 设置默认订阅。 在 RICSVMStartup:13 char:13
这是powerscript:
workflow RICSVMStartup
{
# Grab the credential to use to authenticate
$Cred = Get-AutomationPSCredential -Name 'AzureCredential'
#Connect to Azure
Add-AzureAccount -Credential $Cred
#Select the Azure subscription you want to work against
Select-AzureSubscription -SubscriptionName "Visual Studio Ultimate with MSDN"
# Get all Azure VMs in the subscription that are not stopped and deallocated and shut down
inlinescript
{
Get-AzureVM | where{$_.status -ne 'Started' -and $_.name -like 'RICS*' -and $_.name -ne 'RICSDC2'} | start-AzureVM
}
}
【问题讨论】:
标签: powershell azure runbook