powershell-2.0

How to use the “-Property” parameter for PowerShell's “Measure-Object” cmdlet?

穿精又带淫゛_ 提交于 2020-07-08 06:23:48
问题 Why does $a = GPS AcroRd32 | Measure $a.Count work, when GPS AcroRd32 | Measure -Property Count doesn't? The first example returns a value of 2 , which is what I want, an integer. The second example returns this: Measure-Object : Property "Count" cannot be found in any object(s) input. At line:1 char:23 + GPS AcroRd32 | Measure <<<< -Property Count + CategoryInfo : InvalidArgument: (:) [Measure-Object], PSArgumentException + FullyQualifiedErrorId : GenericMeasurePropertyNotFound,Microsoft