can you help me with this simple example script? How do I refer to "custom expression property" on single one "select-object"?
I would like: single "select-object"
Get-Process | Select-Object Id,
@{name="MyProp"; expression={$_.id}},
@{name="MyPropRef"; expression={$_.MyProp}}
...but third property "MyPropRef" is not displayed!
Id MyProp MyPropRef
-- ------ ---------
3780 3780
While with double select-object piped, "MyPropRef" is displayed
Get-Process | Select-Object Id,
@{name="MyProp"; expression={$_.id}} | Select-Object *,
@{name="MyPropRef"; expression={$_.MyProp}}
Id MyProp MyPropRef
-- ------ ---------
3780 3780 3780
Thanks