Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Script 2 of 2 inside runme.bat to prune DayZ incrementals to one week on the backup drive
- $sourceFolder = "E:\DayZ_backups\"
- $files = Get-ChildItem -Path $sourceFolder -Filter "*.zip" | Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-7) }
- foreach ($file in $files) {
- write "Removing $file"
- Remove-Item -Path $file.FullName -Force
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement