Skip to content

Instantly share code, notes, and snippets.

@mintsoft
Last active January 2, 2016 14:58
Show Gist options
  • Select an option

  • Save mintsoft/8319901 to your computer and use it in GitHub Desktop.

Select an option

Save mintsoft/8319901 to your computer and use it in GitHub Desktop.
Recurse 1 deep in a directory and delete directories older than X
gci *\* | where {$_.PSIsContainer -and $_.CreationTime -lt '2013-01-01T00:00:00'} | %{ write-host $_.FullName; remove-item -recurse $_;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment