add: test number to error
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
@@ -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" }
|
||||
|
@@ -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" }
|
||||
|
@@ -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" }
|
||||
|
@@ -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" }
|
||||
|
@@ -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" }
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user