术语“Get-AzADServicePrincipal”未被识别为 cmdlet、函数的名称

dev*_*ram 4 powershell azure azure-powershell

我正在尝试按照以下 msdn 文档在 azure key Vault 中设置访问策略

https://learn.microsoft.com/en-us/azure/key-vault/general/assign-access-policy-powershell

我按照在 powershell 中安装 AzureAd 并连接 azure 的步骤进行操作。但是当我运行接下来的步骤时,我遇到了这样的问题

Get-AzADServicePrincipal : The term 'Get-AzADServicePrincipal' 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-AzADServicePrincipal -SearchString PI
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-AzADServicePrincipal:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
Run Code Online (Sandbox Code Playgroud)

不确定我缺少哪些步骤。

小智 5

尝试使用 -AllowClobber 再次运行安装。

安装模块-名称 Az -AllowClobber