mirror of
https://github.com/Yamato-Security/WELA.git
synced 2025-12-06 17:22:50 +01:00
add percentage
This commit is contained in:
7
WELA.ps1
7
WELA.ps1
@@ -1025,8 +1025,8 @@ function AuditLogSetting {
|
|||||||
|
|
||||||
if ($outType -eq "std") {
|
if ($outType -eq "std") {
|
||||||
$auditResult | Group-Object -Property Category | ForEach-Object {
|
$auditResult | Group-Object -Property Category | ForEach-Object {
|
||||||
$enabledCount = ($_.Group | Where-Object { $_.Enabled -eq $false }).Count -eq 0
|
$enabledCount = ($_.Group | Where-Object { $_.Enabled -eq $false }).Count
|
||||||
$disabledCount = ($_.Group | Where-Object { $_.Enabled -eq $true }).Count -eq 0
|
$disabledCount = ($_.Group | Where-Object { $_.Enabled -eq $true }).Count
|
||||||
$out = ""
|
$out = ""
|
||||||
$color = ""
|
$color = ""
|
||||||
if ($enabledCount)
|
if ($enabledCount)
|
||||||
@@ -1044,11 +1044,12 @@ function AuditLogSetting {
|
|||||||
$out = "Partially Enabled"
|
$out = "Partially Enabled"
|
||||||
$color = "DarkYellow"
|
$color = "DarkYellow"
|
||||||
}
|
}
|
||||||
|
# TODO add percentage
|
||||||
$enabledPercentage = "0.00%"
|
$enabledPercentage = "0.00%"
|
||||||
if ($enabledCount + $disabledCount -ne 0) {
|
if ($enabledCount + $disabledCount -ne 0) {
|
||||||
$enabledPercentage = "{0:N2}%" -f (($enabledCount / ($enabledCount + $disabledCount)) * 100)
|
$enabledPercentage = "{0:N2}%" -f (($enabledCount / ($enabledCount + $disabledCount)) * 100)
|
||||||
}
|
}
|
||||||
Write-Host "$( $_.Name ): $out($($enabledPercentage))" -ForegroundColor $color
|
Write-Host "$( $_.Name ): $out" -ForegroundColor $color
|
||||||
$_.Group | ForEach-Object {
|
$_.Group | ForEach-Object {
|
||||||
$_.Output($outType)
|
$_.Output($outType)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user