Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save TheRealNoob/3fdc7f27c9db6cee629dd5f2c2effb96 to your computer and use it in GitHub Desktop.

Select an option

Save TheRealNoob/3fdc7f27c9db6cee629dd5f2c2effb96 to your computer and use it in GitHub Desktop.
$backuppath = 'C:\Fraps'
$date = Get-Date
Foreach ($month in 1..12) {
$monthslist = Get-ChildItem $backuppath | where ($_.LastWriteTime.Month -eq $month) | sort #latest file date
#delete all but latest file
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment