PowerTip: Find Stats with PowerShell


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 

Comments (0)

Skip to main content