diff --git a/source/tests/Test-AntiPhishingPolicy.ps1 b/source/tests/Test-AntiPhishingPolicy.ps1 index 61901c6..135a667 100644 --- a/source/tests/Test-AntiPhishingPolicy.ps1 +++ b/source/tests/Test-AntiPhishingPolicy.ps1 @@ -215,7 +215,7 @@ function Test-AntiPhishingPolicy { $auditResult = Initialize-CISAuditResult @params } catch { - Write-Error "An error occurred during the test: $_" + Write-Error "An error occurred during the test $recnum`:: $_" $auditResult = Get-TestError -LastError $_ -recnum $recnum } } diff --git a/source/tests/Test-MailboxAuditingE3.ps1 b/source/tests/Test-MailboxAuditingE3.ps1 index 1e78179..d95968b 100644 --- a/source/tests/Test-MailboxAuditingE3.ps1 +++ b/source/tests/Test-MailboxAuditingE3.ps1 @@ -101,7 +101,7 @@ function Test-MailboxAuditingE3 { $auditResult = Initialize-CISAuditResult @params } catch { - Write-Error "An error occurred during the test: $_" + Write-Error "An error occurred during the test $recnum`:: $_" # Retrieve the description from the test definitions $testDefinition = $script:TestDefinitionsObject | Where-Object { $_.Rec -eq $recnum } $description = if ($testDefinition) { $testDefinition.RecDescription } else { "Description not found" } diff --git a/source/tests/Test-MailboxAuditingE5.ps1 b/source/tests/Test-MailboxAuditingE5.ps1 index 75c6d5e..7dfbe81 100644 --- a/source/tests/Test-MailboxAuditingE5.ps1 +++ b/source/tests/Test-MailboxAuditingE5.ps1 @@ -103,7 +103,7 @@ function Test-MailboxAuditingE5 { $auditResult = Initialize-CISAuditResult @params } catch { - Write-Error "An error occurred during the test: $_" + Write-Error "An error occurred during the test $recnum`:: $_" # Retrieve the description from the test definitions $testDefinition = $script:TestDefinitionsObject | Where-Object { $_.Rec -eq $recnum } $description = if ($testDefinition) { $testDefinition.RecDescription } else { "Description not found" } diff --git a/source/tests/Test-SafeAttachmentsPolicy.ps1 b/source/tests/Test-SafeAttachmentsPolicy.ps1 index dda59f0..b6c257c 100644 --- a/source/tests/Test-SafeAttachmentsPolicy.ps1 +++ b/source/tests/Test-SafeAttachmentsPolicy.ps1 @@ -90,7 +90,7 @@ function Test-SafeAttachmentsPolicy { $auditResult = Initialize-CISAuditResult @params } catch { - Write-Error "An error occurred during the test: $_" + Write-Error "An error occurred during the test $recnum`:: $_" # Retrieve the description from the test definitions $testDefinition = $script:TestDefinitionsObject | Where-Object { $_.Rec -eq $recnum } $description = if ($testDefinition) { $testDefinition.RecDescription } else { "Description not found" } diff --git a/source/tests/Test-SafeAttachmentsTeams.ps1 b/source/tests/Test-SafeAttachmentsTeams.ps1 index b9f29b9..d931347 100644 --- a/source/tests/Test-SafeAttachmentsTeams.ps1 +++ b/source/tests/Test-SafeAttachmentsTeams.ps1 @@ -88,7 +88,7 @@ AllowSafeDocsOpen: $($_.AllowSafeDocsOpen) $auditResult = Initialize-CISAuditResult @params } catch { - Write-Error "An error occurred during the test: $_" + Write-Error "An error occurred during the test $recnum`:: $_" # Retrieve the description from the test definitions $testDefinition = $script:TestDefinitionsObject | Where-Object { $_.Rec -eq $recnum } $description = if ($testDefinition) { $testDefinition.RecDescription } else { "Description not found" } diff --git a/source/tests/Test-SafeLinksOfficeApps.ps1 b/source/tests/Test-SafeLinksOfficeApps.ps1 index d41777f..25433ab 100644 --- a/source/tests/Test-SafeLinksOfficeApps.ps1 +++ b/source/tests/Test-SafeLinksOfficeApps.ps1 @@ -58,7 +58,7 @@ function Test-SafeLinksOfficeApps { $auditResult = Initialize-CISAuditResult @params } catch { - Write-Error "An error occurred during the test: $_" + Write-Error "An error occurred during the test $recnum`:: $_" # Retrieve the description from the test definitions $testDefinition = $script:TestDefinitionsObject | Where-Object { $_.Rec -eq $recnum } $description = if ($testDefinition) { $testDefinition.RecDescription } else { "Description not found" } diff --git a/source/tests/Test-SpamPolicyAdminNotify.ps1 b/source/tests/Test-SpamPolicyAdminNotify.ps1 index 194b441..bb5e7d4 100644 --- a/source/tests/Test-SpamPolicyAdminNotify.ps1 +++ b/source/tests/Test-SpamPolicyAdminNotify.ps1 @@ -108,7 +108,7 @@ function Test-SpamPolicyAdminNotify { $auditResult = Initialize-CISAuditResult @params } catch { - Write-Error "An error occurred during the test: $_" + Write-Error "An error occurred during the test $recnum`:: $_" $auditResult = Get-TestError -LastError $_ -recnum $recnum } }