PSCustomObject Nested Values

Welcome Forums General PowerShell Q&A PSCustomObject Nested Values

This topic contains 1 reply, has 2 voices, and was last updated by

 
Keymaster
3 weeks, 2 days ago.

  • Author
    Posts
  • #112571

    Participant
    Points: 0
    Rank: Member

    Hi,

    I have a PSCustomOject which has a number of nested values. How do extract the nested values?

     

    ID:12345678910
    Name:@{name=Test; email=test@email.com;date=01/01/01}
    Comment:abcdefg
    Info:@{ID=ab123xc; url=http.com}

    So it would be something like Name.Name, Name.Email ,Comment etc.

    Thanks

  • #112841

    Keymaster
    Points: 1
    Rank: Member

    Ah, well, it depends a bit on whether those are actual sub-objects or hash tables. If they're sub-objects, which is a better pattern, then yeah – Name.name, Name.Email, etc.

You must be logged in to reply to this topic.