我在AzureRM.Profile下看到Connect-AzureRmAccount命令:
Get-Command -Module AzureRM.Profile*
CommandType Name Version
Cmdlet Connect-AzureRmAccount 0.13.1
但是当我运行它时,出现以下错误:
Connect-AzureRmAccount : The term 'Connect-AzureRmAccount' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Connect-AzureRmAccount
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Connect-AzureRmAccount:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我搜索了stackoverflow,检查是否具有最新的Powershell版本,是否已安装NetCore.Preview。无法找出问题所在,有人可以指导吗?
答案 0 :(得分:0)
在MS PowerShell GitHub上查看这两个未解决的问题
用于Mac OSX的Powershell Core安装
https://github.com/PowerShell/PowerShell/issues/7178
文档:Connect-AzureRmAccount错误?
这意味着...
“ Connect-AzureRmAccount”一词不被识别为名称
…找不到它,因此就像不是自动加载一样。
因此,请显式导入模块。
Get-Module -ListAvailable
Import-Module -Name AzureRM -DisableNameChecking -Force