Accessing values of object properties in PowerShell
You don't have to iterate over all properties if you just need the value of one of them:
$obj.psobject.properties["foo"].value
Once you iterate over the properties inside the foreach, they become available via $_
(current object symbol). Just like you printed the names of the properties with $_.Name
, using $_.Value
will print their values:
$obj.psobject.properties | % {$_.Value}