I'm going through an array of objects and I can display the objects fine.
$obj
displays each object in my foreach loop fine. I'm trying to access the object fields and their values. This code also works fine:
$obj.psobject.properties
To just see the names of each object's fields, I do this:
$obj.psobject.properties | % {$_.name}
which also works fine.
When I try to access the values of those field by doing this:
$obj.psobject.properties | % {$obj.$_.name}
nothing is returned or displayed.
This is done for diagnostic purposes to see whether I can access the values of the fields. The main dilemma is that I cannot access a specific field's value. I.e.
$obj."some field"
does not return a value even though I have confirmed that "some field" has a value.
This has baffled me. Does anyone know what I'm doing wrong?