From 3ed3142868d34a329f8e95a5b7f68da686166623 Mon Sep 17 00:00:00 2001 From: fukusuket <41001169+fukusuket@users.noreply.github.com> Date: Thu, 3 Apr 2025 22:43:17 +0900 Subject: [PATCH] feat: verbose security --- WELAVerboseSecAudit.psm1 | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/WELAVerboseSecAudit.psm1 b/WELAVerboseSecAudit.psm1 index 10de662f..017f8c0f 100644 --- a/WELAVerboseSecAudit.psm1 +++ b/WELAVerboseSecAudit.psm1 @@ -33,28 +33,26 @@ function ColorPrint { [array]$sub_categories ) - if ($line -notmatch $category) { - return - } + if ($line -eq $category) { + $allEnabled = $true + $allDisabled = $true - $allEnabled = $true - $allDisabled = $true - - foreach ($sub_category in $sub_categories) { - if ($sub_category -notmatch 'enabled') { - $allEnabled = $false + foreach ($sub_category in $sub_categories) { + if ($sub_category -notmatch 'enabled') { + $allEnabled = $false + } + if ($sub_category -notmatch 'disabled') { + $allDisabled = $false + } } - if ($sub_category -notmatch 'disabled') { - $allDisabled = $false - } - } - if ($allEnabled) { - Write-Host $category -ForegroundColor Green - } elseif ($allDisabled) { - Write-Host $category -ForegroundColor Red - } else { - Write-Host $category -ForegroundColor DarkYellow + if ($allEnabled) { + Write-Host $category -ForegroundColor Green + } elseif ($allDisabled) { + Write-Host $category -ForegroundColor Red + } else { + Write-Host $category -ForegroundColor DarkYellow + } } }