mirror of
https://github.com/Yamato-Security/WELA.git
synced 2025-12-06 17:22:50 +01:00
chg: retain -> nooverwrite
This commit is contained in:
5
WELA.ps1
5
WELA.ps1
@@ -1463,8 +1463,9 @@ function AuditFileSize {
|
|||||||
$logInfo = Get-WinEvent -ListLog $logName -ErrorAction Stop
|
$logInfo = Get-WinEvent -ListLog $logName -ErrorAction Stop
|
||||||
$maxLogSize = [math]::Floor($logInfo.MaximumSizeInBytes / 1MB)
|
$maxLogSize = [math]::Floor($logInfo.MaximumSizeInBytes / 1MB)
|
||||||
$recommendedSize = [int]($logNames[$logName][1] -replace " MB\+?", "")
|
$recommendedSize = [int]($logNames[$logName][1] -replace " MB\+?", "")
|
||||||
$correctSetting = if ($maxLogSize -ge $recommendedSize) { "Y" } else { "N" }
|
|
||||||
$logIsFull = $logInfo.FileSize -gt $logInfo.MaximumSizeInBytes
|
$logIsFull = $logInfo.FileSize -gt $logInfo.MaximumSizeInBytes
|
||||||
|
$logMode = if ($logInfo.LogMode -eq "Retain") { "NoOverwrite" } else { $logInfo.LogMode }
|
||||||
|
$correctSetting = if ($maxLogSize -ge $recommendedSize -and $logMode -ne "NoOverwrite") { "Y" } else { "N" }
|
||||||
|
|
||||||
$results += [PSCustomObject]@{
|
$results += [PSCustomObject]@{
|
||||||
LogFile = Split-Path $logInfo.LogFilePath -Leaf
|
LogFile = Split-Path $logInfo.LogFilePath -Leaf
|
||||||
@@ -1473,7 +1474,7 @@ function AuditFileSize {
|
|||||||
Default = $logNames[$logName][0]
|
Default = $logNames[$logName][0]
|
||||||
Recommended = $logNames[$logName][1]
|
Recommended = $logNames[$logName][1]
|
||||||
IsLogFull = $logIsFull
|
IsLogFull = $logIsFull
|
||||||
LogMode = $logInfo.LogMode
|
LogMode = $logMode
|
||||||
CorrectSetting = $correctSetting
|
CorrectSetting = $correctSetting
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user