gpt4 book ai didi

azure - Connect-AzureRMAccount : The term 'Connect-AzureRMAccount' is not recognized as the name of a cmdlet, 函数、脚本文件或可运行程序

转载 作者:行者123 更新时间:2023-12-02 23:00:50 26 4
gpt4 key购买 nike

我在 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。然后我做了以下事情:

  1. 安装模块 AzureRM -AllowClobber -Scope CurrentUser。
  2. 安装模块 Azure。
  3. 安装模块 AzureRM。
  4. 导入模块 AzureRM。
  5. 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com