执行下面的示例代码时出现上述错误。这与使用 -UseWindowsPowerShell 导入有关吗?有什么想法或建议吗?
Import-Module AZ
Import-Module AzureAD -UseWindowsPowerShell
# Import-Module AzureADPreview
Import-Module MSAL.PS
#######################################################################################################################
# Execution starts here
#######################################################################################################################
write-host `n"****Starting Removal Script ****"
$deploy = $false
$MSGraph = "https://graph.microsoft.com/v1.0"
$MSGraphBeta = "https://graph.microsoft.com/beta"
##############################################################################################################
# Load the settings variable from config file.
##############################################################################################################
Write-host("Loading configuration settings from file.")
$settings = Get-Content -Path ".\setupSettings.json" -ErrorAction Stop | Out-String | ConvertFrom-Json
$iefConfPath = ".\setupOutput.json"
$iefConf = Get-Content -Path $iefConfPath -ErrorAction Continue | Out-String | ConvertFrom-Json
Connect-AzureAD -TenantId $settings.b2cTenant
Get-AzureADMSTrustFrameworkPolicy