0

I'm currently running a PowerShell (v3.0) script and I have some jpg files need tidy in a folder. I want to sort the files by the file creation date .but it doesn't work.

get-childitem -path $fipath\*.jpg|get-itemproperty -filter LastWritTime "2013/10/2"

the command get nothing besides err info.

I have tried many other methods but it doesn't work anymore how to use the parameter -filter in PowerShell anyone can gave a idea?

2 Answers 2

1

Try like this :

Get-ChildItem -path $fipath -filter *.jpg |where {$_.LastWriteTime.Date -eq "10/02/2013"}

Sign up to request clarification or add additional context in comments.

2 Comments

ho ho ! thank you!It works well this time!I have tried like this:
ho ho ! thank you!@Tarique Noorain It works well this time!I have tried like this: 'get-childitem -path $filepath -filter *.jpg|where{$_.creationtime.date -eq "2013/10/02"}' but it returns nothing . is it because the file property “LastwriteTime” not equal “creationtime” ?
0

date format should be like MM/DD/YYYY

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.