I need to copy files in one directory to another directory where the lastwritetime is greater than or equal to 3/26/2010 9:00pm. I’m using:
Get-ChildItem C:\pstest\hlstore\folder1\data | where-object {$i.lastwritetime -ge “3/26/2010 9:00 PM”} | Copy-Item -destination c:\pstest\hlstore2\folder1\data
But nothing happens…
Any help would be greatly appreciated.
Thanks!
Emo
Try this:
The name of the “it” variable in
where-objectis$_, not$i.Also, if you’re using these quotes
“”instead of"", I think it would also fail.