Delete file oldet than 7 days

PHOTO EMBED

Tue Mar 09 2021 09:16:54 GMT+0000 (Coordinated Universal Time)

Saved by @vbesse

Get-ChildItem $logFolder | Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-7) } | Remove-Item
content_copyCOPY