Chao Dong
Chao Dong

Reputation: 3

How to use -filter parameter in Powershell

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?

Upvotes: 0

Views: 1379

Answers (2)

Tarique Noorain
Tarique Noorain

Reputation: 26

date format should be like MM/DD/YYYY

Upvotes: 0

Tarique Noorain
Tarique Noorain

Reputation: 26

Try like this :

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

Upvotes: 1

Related Questions