carbonbase
asked on
how to retrieve files of a specific date
Hi I'm trying to list all files which have been modified on a specific date. I would have thought this would be quite a simple and common task in powershell but as always...
I have come up with the following code but unfortunately it doesn't return anything even though I know there are files there with that last write time
I have come up with the following code but unfortunately it doesn't return anything even though I know there are files there with that last write time
Get-ChildItem "C:\Users\jsmith" | Where-Object {$_.LastWriteTime.Date -eq "17/05/2016"} | ForEach-Object {$_.FullName, $_.LastWriteTime}
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
So for reference my code now looks like this:
Get-ChildItem -Recurse "C:\Users\jsmith" | Where-Object {!($_.PSIsContainer)} | Where-Object {$_.LastWriteTime.Date -eq "05/17/2016"} | ForEach-Object {$_.FullName, $_.LastWriteTime}
ASKER