I am using c# to execute PowerShell cmdlets and parsing the cmdlet results (Collection[].Properties["PropertyName"].value) to get the required values.
But some of the results contains a list of deserialized objects. But PowerShell is simply converting these to ArrayList of objects and i am unable to get all the properties of them.
For ex: Get-MailboxDatabase of Exchange Management Shell cmdlet returns list of mailboxdatabase on exchange server (Collection). I can able to get properties like name, server etc... from PSObject.Properties["PropertyName"].Value.
It also contains a list of database copies (something like below)
class MailboxDatabase { DatabaseCopy[] DatabaseCopies; }
the PSObject.Properties["DatabaseCopies"].Value is nothing but an arrayList of objects.
But all the DatabaseCopy properties are not deserialized (Or- i am not sure how to get them).
I can only seee the Name (tostring of DatabaseCopy from the list of arraylists).
Can any one please help me how to get all the deserialized properties of multi-valued results?
For more details you can look at: How to get DatabaseCopies from MailboxDatabase programmatically in C# (wrapped ExchangeMangementShell cmdlets in c#)?
Regards, Dreamer