fix: info count

This commit is contained in:
fukusuket
2025-04-13 22:07:02 +09:00
parent 987fdcf94c
commit 69e9cadd44

View File

@@ -71,11 +71,10 @@
foreach ($level in [WELA]::Levels) { foreach ($level in [WELA]::Levels) {
$count = $this.RulesCount[$level] $count = $this.RulesCount[$level]
if ($level -eq "informational") { if ($level -eq "informational") {
if ($count -eq 0) { if (-not $count) {
$ruleCounts += "info:0" $count = 0
} else {
$ruleCounts += "info:$([string]$count), "
} }
$ruleCounts += "info:$([string]$count)"
} else { } else {
$ruleCounts += "$($level):$($count), " $ruleCounts += "$($level):$($count), "
} }
@@ -1020,11 +1019,10 @@ function AuditLogSetting {
foreach ($level in [WELA]::Levels) { foreach ($level in [WELA]::Levels) {
$count = $_.RulesCount[$level] $count = $_.RulesCount[$level]
if ($level -eq "informational") { if ($level -eq "informational") {
if ($count -eq 0) { if (-not $count) {
$ruleCounts += "info:0" $count = 0
} else {
$ruleCounts += "info:$([string]$count), "
} }
$ruleCounts += "info:$([string]$count)"
} else { } else {
$ruleCounts += "$($level):$($count), " $ruleCounts += "$($level):$($count), "
} }
@@ -1042,11 +1040,10 @@ function AuditLogSetting {
foreach ($level in [WELA]::Levels) { foreach ($level in [WELA]::Levels) {
$count = $_.RulesCount[$level] $count = $_.RulesCount[$level]
if ($level -eq "informational") { if ($level -eq "informational") {
if ($count -eq 0) { if (-not $count) {
$ruleCounts += "info:0" $count = 0
} else {
$ruleCounts += "info:$([string]$count), "
} }
$ruleCounts += "info:$([string]$count)"
} else { } else {
$ruleCounts += "$($level):$($count), " $ruleCounts += "$($level):$($count), "
} }