Source Code and Samples

Friday, 2 February 2007

Delete All Files Older Than 10 Days

Description

This powershell script deletes all from current and sub directories that are older than 10 days.

Source Code

$now = get-date
get-childitem . -recurse where-object {($now - $_.LastWriteTime).Days -lt 10} remove-item

No comments: