I need to copy files modified within a certain time range to a destination directory along with the folder structure. I am using the below powershell script
PS C:\2015-06-27\tfs> get-childitem -recurse | where-object {$_.lastwritetime -gt '06-27-15 01:00' -AND $_.lastwritetime -LT
'06-27-15 11:59' -AND ! $_.PSIsContainer} | Copy-Item -destination c:\test -container - recurse
This copies the files but does not retain the source directory structure. How can I get the files copied and created in their respective directories ?