代码之家  ›  专栏  ›  技术社区  ›  NoviceMe

无法从Mac连接到Azure

  •  1
  • NoviceMe  · 技术社区  · 8 年前

    我在AzureRM下看到了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。已安装预览。我想不出是怎么回事,有人能给我指点一下吗?

    1 回复  |  直到 8 年前
        1
  •  0
  •   postanote    8 年前

    在MS PowerShell GitHub上查看这两个未解决的问题

    针对Mac OSX的Powershell Core安装

    https://github.com/PowerShell/PowerShell/issues/7178

    文档:Connect AzurerAccount错误?

    https://github.com/Azure/azure-docs-powershell/issues/552

    这意味着

    术语“Connect AzurerAccount”无法识别为名称

    找不到它,所以看起来它不是自动加载的。

    因此,请显式导入模块。

    Get-Module -ListAvailable
    Import-Module -Name AzureRM -DisableNameChecking -Force