From d32d6c0b2a92ae5f575af821774090a7b01c80db Mon Sep 17 00:00:00 2001 From: fukusuket <41001169+fukusuket@users.noreply.github.com> Date: Thu, 3 Apr 2025 19:56:10 +0900 Subject: [PATCH] feat: verbose security --- WELAVerboseSecAudit.psm1 | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/WELAVerboseSecAudit.psm1 b/WELAVerboseSecAudit.psm1 index 341e5724..644ba35e 100644 --- a/WELAVerboseSecAudit.psm1 +++ b/WELAVerboseSecAudit.psm1 @@ -21,7 +21,7 @@ function CountRules { $counts[$rule.level]++ } } - $status = if ($filterd_rules[0].applicable) { "enabled" } else { "disabled" } + $status = if ($filterd_rules[0].applicable) { ": enabled" } else { ": disabled" } $result = "$status (critical: $($counts['critical']) | high: $($counts['high']) | medium: $($counts['medium']) | low: $($counts['low']), info: $($counts['informational']))" return $result } @@ -268,25 +268,9 @@ System $msgLines = $msg -split "`n" foreach ($line in $msgLines) { if ($line -match '.*disabled.*\(') { - $parts = $line -split '(disabled.*\))' - foreach ($part in $parts) { - if ($part -match '.*disabled.*$') { - Write-Host -NoNewline $part -ForegroundColor Red - } else { - Write-Host -NoNewline $part - } - } - Write-Host "" + Write-Host -$line -ForegroundColor Red } elseif ($line -match '.*enabled.*\(') { - $parts = $line -split '(enabled.*\))' - foreach ($part in $parts) { - if ($part -match '.*enabled.*$') { - Write-Host -NoNewline $part -ForegroundColor Green - } else { - Write-Host -NoNewline $part - } - } - Write-Host "" + Write-Host $line -ForegroundColor Green } else { Write-Host $line }