mirror of
https://github.com/Yamato-Security/WELA.git
synced 2025-12-09 10:43:01 +01:00
chg: Output horizontally
This commit is contained in:
14
WELA.ps1
14
WELA.ps1
@@ -58,12 +58,24 @@ function Set-Applicable {
|
|||||||
|
|
||||||
function Get-RuleCounts {
|
function Get-RuleCounts {
|
||||||
param ($rules)
|
param ($rules)
|
||||||
$rules | Group-Object -Property level | ForEach-Object {
|
$levels = @("critical", "high", "medium", "low", "informational")
|
||||||
|
$counts = $rules | Group-Object -Property level | ForEach-Object {
|
||||||
[PSCustomObject]@{
|
[PSCustomObject]@{
|
||||||
Level = $_.Name
|
Level = $_.Name
|
||||||
Count = $_.Count
|
Count = $_.Count
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach ($level in $levels) {
|
||||||
|
if (-not ($counts | Where-Object { $_.Level -eq $level })) {
|
||||||
|
$counts += [PSCustomObject]@{
|
||||||
|
Level = $level
|
||||||
|
Count = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $counts
|
||||||
}
|
}
|
||||||
|
|
||||||
function CalculateUsableRate {
|
function CalculateUsableRate {
|
||||||
|
|||||||
Reference in New Issue
Block a user