The only way I could find (for now) is to do something like:
$test = [pscustomobject]@{ First="Donald"; Middle="Fauntleroy"; Last="Duck"; Age=80 } $props=Get-Member -InputObject $test -MemberType NoteProperty foreach($prop in $props) { $propValue=$test | Select-Object -ExpandProperty $prop.Name $prop.Name + "=" + $propValue }
The key uses -ExpandProperty
If someone has a more concise way to do this, write!
source share