Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

How can I expand more than one proprty collection for an object

$
0
0

Hello

Can someone please help me with the following question

if I have an object e.g. $MyObject and it has several properties two of this are collections lets call them prop1 and prop5

if I do the following

$MyObject | select * -expand Prop1

this works and give me all the properties with Prop1 being expanded OK so far but prop5 is still a collection and therefore still shows the type of the collection rather than the properties therein

so I tried this

$MyObject | select * -expand Prop1 | select * -expand Prop5

Now I get all properties with Prop5 being expanded as I wanted but Prop1 is back to a collection and not expanded any more

I want to pipe the object and get all properties and if any are collections expand these, so I can see everything on one screen or export to text file

any suggestions please

Thanks

AAnotherUser__


Viewing all articles
Browse latest Browse all 6937

Trending Articles