mirror of
https://github.com/Yamato-Security/WELA.git
synced 2025-12-06 17:22:50 +01:00
refactor
This commit is contained in:
8
WELA.ps1
8
WELA.ps1
@@ -1466,7 +1466,7 @@ function AuditFileSize {
|
||||
$correctSetting = if ($maxLogSize -ge $recommendedSize) { "Y" } else { "N" }
|
||||
|
||||
$results += [PSCustomObject]@{
|
||||
LogFilePath = Split-Path $logInfo.LogFilePath -Leaf
|
||||
LogFile = Split-Path $logInfo.LogFilePath -Leaf
|
||||
CurrentLogSize = "{0:N2} MB" -f ($logInfo.FileSize / 1MB)
|
||||
MaxLogSize = "$maxLogSize MB"
|
||||
Default = $logNames[$logName][0]
|
||||
@@ -1478,14 +1478,14 @@ function AuditFileSize {
|
||||
# Format-Tableには色つき出力の機能はないので、Write-Hostで色をつける
|
||||
$tableLayout = "{0,-75} {1,-15} {2,-15} {3,-15} {4,-15} {5,-10}"
|
||||
Write-Host ($tableLayout -f `
|
||||
"Log File Path", `
|
||||
"Log File", `
|
||||
"Current Size", `
|
||||
"Max Size", `
|
||||
"Default", `
|
||||
"Recommended", `
|
||||
"Correct Setting")
|
||||
Write-Host ($tableLayout -f `
|
||||
"-------------", `
|
||||
"--------", `
|
||||
"------------", `
|
||||
"--------", `
|
||||
"------", `
|
||||
@@ -1494,7 +1494,7 @@ function AuditFileSize {
|
||||
foreach ($result in $results) {
|
||||
$color = if ($result.CorrectSetting -eq "Y") { "Green" } else { "Red" }
|
||||
Write-Host ($tableLayout -f `
|
||||
$result.LogFilePath, `
|
||||
$result.LogFile, `
|
||||
$result.CurrentLogSize, `
|
||||
$result.MaxLogSize, `
|
||||
$result.Default, `
|
||||
|
||||
Reference in New Issue
Block a user