PowerTip: Find Stats with PowerShell

Doctor Scripto

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 

0 comments

Discussion is closed.

Feedback usabilla icon