Skip to content

Commit b0deb88

Browse files
committed
added fallback for risk property
1 parent 0c3565c commit b0deb88

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

src/powershell/tests/Test-Assessment.50001.ps1

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,13 @@ securityresources
403403
$firstRow = $rows[0]
404404
$testId = $recName
405405
$title = $firstRow.recommendationDisplayName
406-
$risk = $firstRow.severity
406+
$risk = switch ($firstRow.severity) {
407+
'Critical' { 'High' } # New classification added by Microsoft on March 2025
408+
'High' { 'High' }
409+
'Medium' { 'Medium' }
410+
'Low' { 'Low' }
411+
default { 'Medium' } # Treat None/Informational as Medium
412+
}
407413

408414
# MCSB enrichment lookup — populated when this rec also appears in MCSB
409415
$mcsbForThisRec = if ($mcsbByRec.ContainsKey($recName)) { $mcsbByRec[$recName] } else { @{} }
@@ -576,7 +582,13 @@ $tableRows
576582
$firstRow = $rows[0]
577583
$testId = $recName
578584
$title = if (-not [string]::IsNullOrWhiteSpace($firstRow.recommendationDisplayName)) { $firstRow.recommendationDisplayName } else { $recName }
579-
$risk = $firstRow.severity
585+
$risk = switch ($firstRow.severity) {
586+
'Critical' { 'High' } # New classification added by Microsoft on March 2025
587+
'High' { 'High' }
588+
'Medium' { 'Medium' }
589+
'Low' { 'Low' }
590+
default { 'Medium' } # Treat None/Informational as Medium
591+
}
580592

581593
# Category: MCSB domain name(s)
582594
$mcsbDomainList = $null

0 commit comments

Comments
 (0)