Powershell Module to work with log files
LogUtils may be installed from PSGallery
Install-Module -Name LogUtils
# Move .log files from C:\Logs to C:\Archive, adding a default timestamp to the file name
Backup-Logfile -logPath "C:\Logs" -archivePath "C:\Archive\"
# Remove .log files that haven't been modified in the last 10 days from C:\Archive
Remove-Logfile -logPath -archivePath "C:\Archive\" -numberofDaystoKeepFiles 10