我在 Azure PowerShell 中遇到了问题。我无法连接到 AzureRM 帐户。它显示此错误:
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
我正在 Mac OS 中执行此操作。首先,我使用以下命令安装了 PowerShell:brew cask install PowerShell。 然后我做了以下事情:
- 安装模块 AzureRM -AllowClobber -Scope CurrentUser。
- 安装模块 Azure。
- 安装模块 AzureRM。
- 导入模块 AzureRM。
- Connect-AzureRMAccount(它向我显示上述错误)。
我期待第 5 步能够弹出登录窗口。请帮忙
最佳答案
AzureRM 模块在 macOS 上不可用。您将需要 Az 模块。它具有大量奇偶校验和用于启用兼容别名的选项 (Enable-AzureRmAlias
):
https://azure.microsoft.com/en-us/blog/azure-powershell-cross-platform-az-module-replacing-azurerm/
请记住,一般而言,此模块代表 future (Windows、macOS 和 Linux...以及 Azure Cloud Shell)。
以下 cmdlet 很有用:
Install-Module -Name Az -AllowClobber
Import-Module Az
Connect-AzAccount
关于azure - Connect-AzureRMAccount : The term 'Connect-AzureRMAccount' is not recognized as the name of a cmdlet, 函数、脚本文件或可运行程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56238475/