术语 'Get-AzureSubscription' 未被识别为 cmdlet、函数、脚本文件或可执行程序的名称

The term 'Get-AzureSubscription' is not recognized as a name of a cmdlet, function, script file, or executable program

我使用以下命令安装了 Az 模块,但仍然出现以下错误。

Install-Module -Name Az -AllowClobber -Scope AllUsers
Get-AzureSubscription: The term 'Get-AzureSubscription' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

有什么想法吗?

获取订阅的命令是Get-AzSubscription

大多数 Azure 命令包括 Az,而不是 Azure

您可能需要先使用 Connect-AzAccount 登录,然后通过浏览器弹出窗口登录。

Sign in with Azure Powershell - Microsoft