fix: throw error if no test definitioins after SPO removal

This commit is contained in:
DrIOS
2024-06-08 17:26:30 -05:00
parent 9199d97fc2
commit 4a4d200197

View File

@@ -152,6 +152,9 @@ function Invoke-M365SecurityAudit {
if (-not $TenantAdminUrl) { if (-not $TenantAdminUrl) {
$requiredConnections = $requiredConnections | Where-Object { $_ -ne 'SPO' } $requiredConnections = $requiredConnections | Where-Object { $_ -ne 'SPO' }
$testDefinitions = $testDefinitions | Where-Object { $_.Connection -ne 'SPO' } $testDefinitions = $testDefinitions | Where-Object { $_.Connection -ne 'SPO' }
if ($null -eq $testDefinitions) {
throw "No tests to run as no SharePoint Online tests are available."
}
} }
} }
# Establishing connections if required # Establishing connections if required