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