Copy Files by Date Modified


/ Published in: Windows PowerShell
Save to your folder(s)



Copy this code and paste it in your HTML
  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 {($_.LastWriteTime.Date -ge $StartDate.Date) -and ($_.LastWriteTime.Date -le $EndDate.Date)} | Copy-Item -Destination 'C:\logs'

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.