From 69e9cadd44acdb62e17718f7df8dfec12f7ba0e6 Mon Sep 17 00:00:00 2001 From: fukusuket <41001169+fukusuket@users.noreply.github.com> Date: Sun, 13 Apr 2025 22:07:02 +0900 Subject: [PATCH] fix: info count --- WELA.ps1 | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/WELA.ps1 b/WELA.ps1 index bfd07ba7..9e117c5d 100644 --- a/WELA.ps1 +++ b/WELA.ps1 @@ -71,11 +71,10 @@ foreach ($level in [WELA]::Levels) { $count = $this.RulesCount[$level] if ($level -eq "informational") { - if ($count -eq 0) { - $ruleCounts += "info:0" - } else { - $ruleCounts += "info:$([string]$count), " + if (-not $count) { + $count = 0 } + $ruleCounts += "info:$([string]$count)" } else { $ruleCounts += "$($level):$($count), " } @@ -1020,11 +1019,10 @@ function AuditLogSetting { foreach ($level in [WELA]::Levels) { $count = $_.RulesCount[$level] if ($level -eq "informational") { - if ($count -eq 0) { - $ruleCounts += "info:0" - } else { - $ruleCounts += "info:$([string]$count), " + if (-not $count) { + $count = 0 } + $ruleCounts += "info:$([string]$count)" } else { $ruleCounts += "$($level):$($count), " } @@ -1042,11 +1040,10 @@ function AuditLogSetting { foreach ($level in [WELA]::Levels) { $count = $_.RulesCount[$level] if ($level -eq "informational") { - if ($count -eq 0) { - $ruleCounts += "info:0" - } else { - $ruleCounts += "info:$([string]$count), " + if (-not $count) { + $count = 0 } + $ruleCounts += "info:$([string]$count)" } else { $ruleCounts += "$($level):$($count), " }