Home > other >  The term 'Set-AzureADGroup' is not recognized as a name of a cmdlet
The term 'Set-AzureADGroup' is not recognized as a name of a cmdlet

Time:11-04

I am trying to use a powershell command Set-AzureADGroup from AzureAD on Mac. but it kept failing:

Set-AzureADGroup: The term 'Set-AzureADGroup' 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.

Here are the steps I took:

Import-Module AzureAD -UseWindowsPowerShell

Set-AzureADGroup

I am using powershell 7.1.5 and my psmodulepath seems right:

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

If I use:

>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.

CodePudding user response:

The docs for the AzureAD module indicate that it only runs on Windows.

While the error message you get when you attempt to import the module on an unsupported platform (such as macOS in your case) unfortunately doesn't explicitly say so, it can be inferred from its wording: the types in the System.Windows.Forms namespace are available on Windows only.

  • Related