I am interested in file searching by custom properties. For example, I want to find all JPEG-images with certain dimensions. Something looks like
Get-ChildItem -
Here's an alternative implementation as a (almost) one-liner:
Add-Type -Assembly System.Drawing
Get-ChildItem -Path C:\ -Filter *.jpg -Recursive | ForEach-Object { [System.Drawing.Image]::FromFile($_.FullName) } | Where-Object { $_.Width -eq 1024 -and $_.Height -eq 768 }
If you are going to need to run this command more than once, I would recommend Johannes' more complete solution instead.