Posted By

danfsmith on 07/27/11


Tagged

date files


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

michanne


Copy Files by Date Modified


 / Published in: Windows PowerShell
 

  1. $StartDate = (get-date -year 2011 -month 6 -day 2)
  2. $EndDate = (get-date -year 2011 -month 6 -day 4)
  3. Get-ChildItem t:\ -Recurse | Where-Object {($_\3.LastWriteTime.Date -ge $StartDate.Date) -and ($_\3.LastWriteTime.Date -le $EndDate.Date)} | Copy-Item -Destination 'C:\logs'

Report this snippet  

You need to login to post a comment.