Advertisement
Ubidibity

Clean-Zips.ps1

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