This commit is contained in:
fukusuket
2025-04-20 09:50:17 +09:00
parent 74c0393993
commit b3f672733d

View File

@@ -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, `