I wondered if there was a way of copying files, based on their Property "CreationTime" as I can already do with copying spefic file types?
I have been playing with both the -Filter and -Exclude paramaters but with no luck so far.
copy from C:\testfolder1\ to C:\testfolder2
I would be greatful for any help you can offer.
-Filter and -Exclude operate against the filename. You'll need an interim filter.
Get-ChildItem c:\source | Where-Object CreationTime -gt [datetime]'1/1/2001' | Copy-Item c:\destination
Something vaguely like that, conceptually.
Don, thats lovely thank you, I think I understand a bit better now.
No, you have to have an actual value. It's just like comparing two numbers. But you can make one.
$tomorrow = (Get-Date).AddDays(1)
Pretty sure it's all in "Learn PowerShell in a Month of Lunches" if you want to explore deeper :).
You must be logged in to reply to this topic.