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

标签 azure powershell 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

不确定我缺少哪些步骤。

最佳答案

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

安装模块-名称 Az -AllowClobber

关于azure - 术语 'Get-AzADServicePrincipal' 未被识别为 cmdlet、函数的名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67820777/

相关文章:

azure - 如何使用 Azure 自动化帐户从不同订阅启动虚拟机

powershell - 在 Powershell 中处理数组(使用 Pester 进行测试)

windows - IIS 或任何文件夹服务器 2012 R2 中不存在 adfs 目录的虚拟或物理位置

c# - Xamarin.Forms 无法安装 Microsoft.Azure.Mobile.Client.SQLiteStore 2.1.1

azure - 未找到 Az 包

powershell - 使用 PowerShellGet 安装 PowerShell 模块后写入配置文件

powershell - Splatting 哈希表 - Start-Process -ArgumentList

python - generate_blob_sas 创建无效的 SAS token

azure - 具有单一指标的 AppInsights 磁贴

powershell - PowerShell脚本运行完美,但需要8个小时以上才能运行