【问题标题】:Set-AzureSubscription : A parameter cannot be found that matches parameter name 'DefaultSubscription'Set-AzureSubscription:找不到与参数名称“DefaultSubscription”匹配的参数
【发布时间】:2013-12-23 13:00:34
【问题描述】:

我正在使用“Set-AzureSubscription –DefaultSubscription $SubscriptionID”API 在 powershell 中设置 azure 订阅。

但它给我的错误是“Set-AzureSubscription:找不到与参数名称‘DefaultSubscription’匹配的参数。”

如果 azure powershell API 有变化,请指导我。

【问题讨论】:

    标签: azure powershell-2.0


    【解决方案1】:

    是的,在最近的更新中,PowerShell API 发生了变化。 Select-AzureSubscription 现在具有设置默认值的参数。该参数的名称是 -Default(而不是 -DefaultSubscription)。

    【讨论】:

    • 谁能告诉我“Start-AzureVM”API 是否有任何变化?它受到以下命令的打击“Start-AzureVM -ServiceName (get-azurevm | where {$_.name -eq $VMName}).ServiceName -NAME $VMName”
    【解决方案2】:

    从 0.7.2 版本开始,您需要使用订阅名称调用 Select-AzureSubscription,如下所示:

    Select-AzureSubscription -SubscriptionName "mySubscriptionName"
    

    您可以通过运行以下命令检查您拥有的 Azure cmdlet 版本:

    get-module azure
    

    返回如下结果:

    ModuleType 版本名称 ExportedCommands
    ---------- -------- ---- ----
    二进制 0.7.2 Azure {Add-AzureAccount, Add-AzureCacheWorkerRole, Add-AzureCertificate, Add-AzureDataDisk...}

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-15
      • 2019-10-17
      相关资源
      最近更新 更多