• Welcome to ITBible, we're your #1 resource for enterprise or homelab IT problems (or just a place to show off your stuff).
  1. WizardTux

    PowerShell Delete files older than x amount of days from Downloads

    Pretty simple script, this just remove files from your downloads folder that are older than x amount of days (by default its set to 60). $Paths = @( "%userprofile%\Downloads\" ) $Days = 60 $limit = (Get-Date).AddDays(-$Days) foreach ($Path in $Paths) { # Delete files older than the...