-
Notifications
You must be signed in to change notification settings - Fork 54
Powershell 7.0 + AzureAD #544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you not do what you want with the |
No not really, this is part of a larger AAD automation case... How would you set the ResourceAccess on the Application using Az module, can't find anything on this ? |
@johlindr When a module is imported with the Workarounds:
Also, consider using the Microsoft Graph module: it works in PowerShell 7 and it may be able to address you scenario. |
Thanks AnatoliB, this behavior seems logical to how the -UseWindowsPowershell works, bit troublesome indeed, should be more straight forward. Hopefully the AzureAD module would be ported to PS core at some point. I'll give your suggestion a go. |
There seems to be some issue with the PS 7.0 and Azure AD module, (AzureAD module installed using dependency management)
Import-Module AzureAD -UseWindowsPowerShell
$requiredResourceAccess = New-Object -TypeName "Microsoft.Open.AzureAD.Model.RequiredResourceAccess"
$resourceAccess = New-Object -TypeName "Microsoft.Open.AzureAD.Model.ResourceAccess"
@{
'Az' = '4.'
'AzureAD' = '2.'
}
The above will fail with the following Exception:
[Error] ERROR: Cannot find type [Microsoft.Open.AzureAD.Model.RequiredResourceAccess]: verify that the assembly containing this type is loaded.
[Error] ERROR: Cannot find type [Microsoft.Open.AzureAD.Model.ResourceAccess]: verify that the assembly containing this type is loaded.
The sample is simplified and was tested on a vanilla function to eliminate env. specific problems. Interesting is that rest of AzureAD module functions I've tested works appropriately (Connect-AzureAD etc.)
The text was updated successfully, but these errors were encountered: