【问题标题】:The term 'Set-AzureADGroup' is not recognized as a name of a cmdlet术语“Set-AzureADGroup”未被识别为 cmdlet 的名称
【发布时间】:2021-11-03 00:00:17
【问题描述】:

我正在尝试在 Mac 上使用来自 AzureAD 的 powershell 命令 Set-AzureADGroup。但它一直失败:

Set-AzureADGroup:术语“Set-AzureADGroup”未被识别为 cmdlet、函数、脚本文件或可执行程序的名称。 检查名称的拼写,如果包含路径,请验证路径是否正确,然后重试。

这是我采取的步骤:

导入模块 AzureAD -UseWindowsPowerShell

设置-AzureADGroup

我正在使用 powershell 7.1.5 并且我的 psmodulepath 似乎是正确的:

PS /Users/**name> echo $env:PSModulePath /Users/**name/.local/share/powershell/Modules:/usr/local/share/powershell/Modules:/usr/local/microsoft/powershell/7/Modules

如果我使用:

>Import-Module AzureAD
Import-Module: Could not load file or assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.

【问题讨论】:

    标签: macos powershell azure-active-directory


    【解决方案1】:

    docs for the AzureAD module 表示它只能在 Windows 上运行

    虽然您尝试在不受支持的平台(例如您的情况下的 macOS)上导入模块时收到的错误消息并没有明确这么说,但可以推断 从其措辞来看:System.Windows.Forms namespace 中的类型仅在 Windows 上可用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-12
      • 2017-12-11
      • 2021-12-09
      • 2020-02-25
      • 2020-04-17
      • 2018-09-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多