COMMAND EVERYTHING.
Count input values and calculate a total without changing the source collection.
PowerShell · Risk: Low · Documentation VerifiedLast verified: 2026-10-26
Returns a measurement object with Count equal to three and Sum equal to six.
Measure-Object [[-Property] <PSPropertyExpression[]>] [-InputObject <PSObject>]
[-StandardDeviation] [-Sum] [-AllStats] [-Average] [-Maximum] [-Minimum]
[<CommonParameters>]Copied 0 timesNo elevation is required for the in-memory examples. Filesystem operations require read or traversal access to the selected path.
PowerShell · 7.6; filesystem examples require the FileSystem provider
-SumPowerShell 7.6 with Microsoft.PowerShell.Utility. For file examples, replace the sample path with an accessible file or directory.
Low risk for the supplied example. Protect file contents, paths, and returned system metadata. Review any modifications to the example before execution.
1, 2, 3 | Measure-Object -SumReturns a measurement object with Count equal to three and Sum equal to six.
Sign in to keep your own command reference lists.
Explain or customize this command with AI