add: test number to error

This commit is contained in:
DrIOS
2024-08-04 13:49:58 -05:00
parent 9e3058add4
commit 357f284d08
7 changed files with 7 additions and 7 deletions

View File

@@ -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" }