Calculated properties in Select-Object
Calculated properties can be used in Select-Object
to format results in a particular way:
Get-ADUser | select GivenName, @{Name='Hello', Expression={'World {0}' -f $_.Surname}}
Shortcuts of n
and e
can be used for the keys, i.e.
Get-ADUser | select GivenName, @{n='Hello', e={'World {0}' -f $_.Surname}}