Fix: Export when tests with nested tables not included.

This commit is contained in:
DrIOS
2024-06-26 08:54:57 -05:00
parent 51f662ff58
commit 59278f4a27

View File

@@ -191,7 +191,7 @@ function Export-M365SecurityAuditTable {
} }
else { else {
if ($ExportOriginalTests) { if ($ExportOriginalTests) {
Write-Information "No specified tests were included in the export other than the full audit results." -InformationAction Continue Write-Information "Full audit results exported however, none of the following tests had exports: `n1.1.1, 1.3.1, 6.1.2, 6.1.3, 7.3.4" -InformationAction Continue
} }
else { else {
Write-Information "No specified tests were included in the export." -InformationAction Continue Write-Information "No specified tests were included in the export." -InformationAction Continue
@@ -201,9 +201,12 @@ function Export-M365SecurityAuditTable {
if ($ExportOriginalTests) { if ($ExportOriginalTests) {
# Define the test numbers to check # Define the test numbers to check
$TestNumbersToCheck = "1.1.1", "1.3.1", "6.1.2", "6.1.3", "7.3.4" $TestNumbersToCheck = "1.1.1", "1.3.1", "6.1.2", "6.1.3", "7.3.4"
if ($exportedTests.Count -gt 0) {
# Check for large details and update the AuditResults array $updatedAuditResults = Get-ExceededLengthResultDetail -AuditResults $AuditResults -TestNumbersToCheck $TestNumbersToCheck -ExportedTests $exportedTests -DetailsLengthLimit 30000 -PreviewLineCount 25
$updatedAuditResults = Get-ExceededLengthResultDetail -AuditResults $AuditResults -TestNumbersToCheck $TestNumbersToCheck -ExportedTests $exportedTests -DetailsLengthLimit 30000 -PreviewLineCount 25 }
else {
$updatedAuditResults = $auditResults
}
$originalFileName = "$ExportPath\$timestamp`_M365FoundationsAudit.csv" $originalFileName = "$ExportPath\$timestamp`_M365FoundationsAudit.csv"
if ($ExportToExcel) { if ($ExportToExcel) {
$xlsxPath = [System.IO.Path]::ChangeExtension($originalFileName, '.xlsx') $xlsxPath = [System.IO.Path]::ChangeExtension($originalFileName, '.xlsx')