How to Import Azure AD Module into Universal Rest API?

Hi Adam,
I have in my pwsh azure ad installed, but somehow its not being recognized by PSU in the machine

I get this error:

The term ‘Connect-AzureAD’ 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.
at , : line 9
at , : line 1
The term ‘New-AzureADMSInvitation’ 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.
at , : line 10
at , : line 1
The term ‘Disconnect-AzureAD’ 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.
at , : line 11
at , : line 1

Hello, I don’t know if it works for this module. But it should work with any module.
You can import modules with the import-module commandlet directly in your endpoint.
Or you can configure your module ( in the psd1) to let powershell import it when u use a commandlet.
Just keep the rootmodule line empty and uncomment the nestedmodule line and enter the name of the module as the value.
In a powershell console, with get-module -listavailable you should see your module in the list with a list of the commandlets exported.
Another alternative I think is to create a persistent environnement for your endpoints in PSU that loads your module. ( it is explained in the PSU documentation )

We got this to work on our PSU servers. Currently works with 2.1.2. I’d log into the server you’re running PSU on and make sure that ‘Az.Accounts’ is installed on it. If not install it

Get-Module -ListAvailable