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