Pode's inbuilt file logging logic does not cleanup the old log files, but creates below exception/error:
Date: 2024-10-24 03:07:46
Level: Error
ThreadId: 0
Server: iantstm9t1ctx01
Category: InvalidData: (:) [Invoke-PodeScriptBlock], ParameterBindingValidationException
Message: Cannot bind argument to parameter 'Path' because it is null.
StackTrace: at <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\Pode\2.11.0\Private\Logging.ps1: line 69
at Invoke-PodeScriptBlock, C:\Program Files\WindowsPowerShell\Modules\Pode\2.11.0\Public\Utilities.ps1: line 581
at <ScriptBlock>, <No file>: line 59
Describe the Bug
Pode's inbuilt file logging logic does not cleanup the old log files, but creates below exception/error:
Steps To Reproduce
Steps to reproduce the behavior:
Expected Behavior
Pode should cleanup file accoring
-MaxDays
parameter without throwing an exception.Proposed Fix
Issue can be fixed by removing
$_
from the Remove-Item command inGet-PodeLoggingFileMethod
:I'll prepare a pull request.
Platform