April 11th, 2015

PowerTip: Find Stats with PowerShell

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to find stats of objects.

Hey, Scripting Guy! Question How can I use Windows PowerShell to see the minimum, maximum, and average values of a
           specific property in a series of objects?

Hey, Scripting Guy! Answer Pipe the objects to the Measure-Object cmdlet, specify the property you seek, and use
           the AverageMaximumSum, and Minimum switches, for example:

$objects | Measure-Object -Property numberofwords -Sum -Average -Maximum -Minimum 

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.

Feedback