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" } $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, `