azure - 无法识别 Connect-AzureAd
问题描述
我试图让这个命令在我的 MAC 操作系统上运行,甚至安装我在其他博客中找到的所有模块,比如 AzureAD、AzureADPreview.¨。我仍然收到同样的信息。有人可以给我一些关于修复的线索吗?
Connect-AzureAD: The term 'Connect-AzureAD' 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.
Name Value
---- -----
PSVersion 7.0.3
PSEdition Core
GitCommitId 7.0.3
OS Darwin 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
解决方案
您收到一条提示无法识别 cmdlet 的错误消息的事实表明您尚未安装或导入正确的模块。关于通常不使用AzureAD 模块的重要注意事项,您通常应该尽可能地使用AZ 模块。
如果您特别想使用,AzureAD
那么使用可以使用以下
Register-PackageSource -Trusted -ProviderName 'PowerShellGet' -Name 'Posh Test Gallery' -Location https://www.poshtestgallery.com/api/v2/
Install-Module AzureAD.Standard.Preview
import-Module AzureAD.Standard.Preview
我建议您使用以下AZ Module
方法:
Install-Module az
Import-Module az
connect-azureAD
对于您可以使用的 cmdletconnect-azaccount
因为您使用的是 Mac,您将不会遇到 Windows 提示登录,您将获得一个链接,您需要手动使用该链接登录以进行身份验证。
推荐阅读
- sql - 通过另外两个 ID 列将相关 ID 链接在一起
- android - Ionic 4 Angular AlertController 消息未在发布版本中显示
- c - 函数“main”的代码在目标文件中的什么位置开始?
- javascript - chrome 扩展开发:带有图像的建议
- c# - Azure 存储资源管理器:如何使用“包含”查询表存储行键?
- javascript - 如何使用 Jest 在事件侦听器中测试异步函数?
- typescript - 如何连接两个(管道标准输入和标准输出)Deno 子进程?
- c# - C# 播放 Spotify Uri
- r - 从列表中选择多个元素以构建数据框的最快方法
- ios - 当通过@Published 更改类中的属性值时,某些observedObjects 不会更新?