fix: pre test call

This commit is contained in:
DrIOS
2025-04-19 19:33:22 -05:00
parent 6cb086f8f1
commit 445c962af0
3 changed files with 6 additions and 2 deletions

View File

@@ -225,11 +225,13 @@ function Invoke-M365SecurityAudit {
}
}
elseif ($script:PnpAuth = $true) {
# Ensure MgGraph assemblies are loaded prior to running PnP cmdlets
Get-MgGroup -Top 1 -ErrorAction SilentlyContinue | Out-Null
}
# Load test definitions from CSV
$testDefinitionsPath = Join-Path -Path $PSScriptRoot -ChildPath 'helper\TestDefinitions.csv'
$testDefinitions = Import-Csv -Path $testDefinitionsPath
# ################ Check for $Version -eq '4.0.0' ################
if ($Version -eq '4.0.0') {
$script:Version400 = $true
$testDefinitionsV4Path = Join-Path -Path $PSScriptRoot -ChildPath 'helper\TestDefinitions-v4.0.0.csv'