Azure Resource Group Error: A parameter cannot be found that matches parameter name 'EnvironmentName'

Azure Resource Group Error: A parameter cannot be found that matches parameter name 'EnvironmentName'

我正在尝试按照 this 教程使用 Visual Studio 2015 创建 Azure 资源组项目。但是当我部署时,出现了一个奇怪的错误:

[ERROR] Add-AzureRmAccount : A parameter cannot be found that matches parameter name 
[ERROR] 'EnvironmentName'.
[ERROR] At line:1 char:2379
[ERROR] + ... xmg' -AccountId 'myemail@outlook.com' -EnvironmentName 'AzureC ...
[ERROR] +                                                  ~~~~~~~~~~~~~~~~
[ERROR]     + CategoryInfo          : InvalidArgument: (:) [Add-AzureRmAccount], Param 
[ERROR]    eterBindingException
[ERROR]     + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Azure.Commands. 
[ERROR]    Profile.AddAzureRMAccountCommand
[ERROR]  
[ERROR] Run Login-AzureRmAccount to login.

我更新了最新版的Azure SDK,还是一样的错误。请帮我解决这个问题。

A​​zure PowerShell cmdlet 的 4.x 版本发生了重大变化,短期修复是回滚到 3.8。

如果您使用 "Install-Module AzureRM" 安装 cmdlet,请卸载并使用 -RequiredVersion 参数重新安装,例如

Install-Module AzureRM -RequiredVersion 3.8.0 -Force -AllowClobber

如果您通过 WebPI/MSI/AzureSDK 安装安装了 cmdlet,则从控制面板卸载 Azure PowerShell 并从此处安装 3.8 版本:https://github.com/Azure/azure-powershell/releases/download/v3.8.0-April2017/azure-powershell.3.8.0.msi

我们正在努力修复 4.x...