powershell - 获取 AzureRmResourceGroup : The term 'Get-AzureRmResourceGroup' is not recognized as the name of a cmdlet

标签 powershell azure azure-powershell

我正在尝试在 PowerShell 中从我的 Azure 订阅检索资源组名称:

Get-AzureRmResourceGroup | select resourcegroupname

但我收到以下错误:

Get-AzureRmResourceGroup : The term 'Get-AzureRmResourceGroup' 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
+ Get-AzureRmResourceGroup | select resourcegroupname
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-AzureRmResourceGroup:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

我有 PowerShell 5.0 并导入了最新的 Azure 模块。为什么不包括在内?

最佳答案

您需要首先使用以下命令安装 Azure RM 模块:

Install-Module AzureRM 

然后需要导入模块来使用:

Import-Module AzureRM

关于powershell - 获取 AzureRmResourceGroup : The term 'Get-AzureRmResourceGroup' is not recognized as the name of a cmdlet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41592445/

相关文章:

python - 设置 Mlflow 后端 (SQLite) 和工件(Azure Blob 存储)存储

azure - Azure 流分析中的跳跃窗口

azure - Azure kubernetes 上的 PVC 卷安装需要一个多小时

c# - 将变量从 C# 传递到 Powershell

powershell - 覆盖 PowerShell 参数的解析模式?

powershell - 截断可变文本字符串

powershell - 由于超时时间已过错误,此操作返回

python - 如何将依赖项安装到 Azure Pipeline Python

powershell - Azure Powershell - 版本 1 中的 Switch-AzureMode 错误

azure - 查找 Azure 服务器的实例 ID