Using Powershell to search (Get-ChildItem) for specific files that you need to copy to a new location with the same folder structure seemed to be not trivial with Powershell. Combining Get-ChildItem with Copy-Item usually gets you all the files that meet your criteria but in a single folder at the destination rather than following the same folder structure at the destination. If that is what you want, then perfect. But if you want to have the files saved using the same source folder structure at the destination then I have some sample code that will work. Note I intentionally did not try to make this a one-line program. I wanted to breakout the various pieces and document their purpose, so you have useful code down the road to use for other/similar purposes.
My requirement was I needed to move all files less than 3 hours old (either new or modified within the last 3 hours) from a network share to a local drive (D:). But I needed the folder structure to be intact. I'm sure many of you are screaming use RoboCopy. I have used it for many things and it does a great job. I wanted something within PowerShell and I was having problems getting as granular (3 hour limit) as I needed.
Here is the PowerShell code I used to solve this requirement: