February 6th, 2014

PowerTip: Use PowerShell to Count Photos

Doctor Scripto
Scripter

Summary: Learn to use Windows PowerShell to count the number of photographs you have on your computer.

Hey, Scripting Guy! Question How can I use Windows PowerShell to count all the photographs I have on a specific drive?

Hey, Scripting Guy! Answer Use the Get-ChildItem cmdlet to find all of the photos, and then pipe the results to the 
          Measure-Object cmdlet. The following command counts the number of .jpg and .crc files on drive E:

Get-ChildItem -Recurse -Include *.jpg, *.cr2 -Path e:\ | Measure-Object

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.