I'm doing a bit of Powershell scripting ( for the first time ) to look at some stuff in a Sharepoint site and what I would like to be able to do is to go through a list of properties of an object and just output their values in a "property-name = value" kind of format.
Now I can find the list of elements using this:
$myObject | get-member -membertype property
Which will return a list of all the properties in a very clear and readable fashion. But what I need is to find a value for those properties.
In some scripting languages I could have a kind of eval( "$myObject.$propertyName" ) call - where I have extracted $propertyName from the get-member output - and have it evaluate the string as code, which for the kind of quick-and-dirty solution I need would be fine.
Does this exist in Powershell or is there a more convenient way to do it? Should I be using reflection instead?