Measure-Object should handle `ScriptBlock` properties. Fixed by renaming `MshExpression` to `PSPropertyExpression` and making it public. Then in `MeasureObjectCommand`, lifting it up to the parameter level. Previously the implementation exposed the Property as a string and wrapped it internally as a `PSPropertyExpression`. Now the parameter type is `PSPropertyExpression` directly allowing for both wildcard strings and `ScriptBlock`. `PSPropertyExpression` now lives in a public namespace where it can be used by cmdlet and script authors to easily add the same type of functionality to their commands. I also modified `PSPropertyExpression` to handle hashtables properly as objects so @{prop = 3} | measure-object prop and @{prop = 3} | measure-object {$_.prop} will work the same. (Previously the example using just the property name would fail.) |
||
---|---|---|
.. | ||
Classes | ||
Interop/DotNet | ||
Operators | ||
Parser | ||
Scripting | ||
CompletionTestSupport.psm1 |