Multiple variables challenge

Welcome Forums General PowerShell Q&A Multiple variables challenge

Viewing 3 reply threads
  • Author
    Posts
    • #259192
      Participant
      Topics: 4
      Replies: 4
      Points: 46
      Rank: Member

      I will try to ask my question via sample code

    • #259195
      Participant
      Topics: 12
      Replies: 541
      Points: 1,314
      Helping Hand
      Rank: Community Hero

      Use a PS custom object:

      Or better yet, I would pick the desired properties from each of the 2 input objects (the one from get-teams and the one from get-settings), and create a PS custom object that is to be used for the rest of the script. Joining the 2 objects would be by the ‘id’ property as in:

      This is coded such that if you would like to add/remove properties from your custom object, you only need to change the $TeamDesiredProperyList and/or $SettingsDesiredProperyList arrays..

      • This reply was modified 4 weeks, 1 day ago by Sam Boutros.
    • #259216
      Participant
      Topics: 2
      Replies: 9
      Points: 85
      Rank: Member

      That should be straightforward. In second function use get-variable

       

      • This reply was modified 4 weeks, 1 day ago by sasaz12.
    • #259846
      Participant
      Topics: 4
      Replies: 4
      Points: 46
      Rank: Member

      Thank you Sam for your help as well. I was using functions so I needed to get variable outside of the function that are dynamically created and Sasa’s solutions worked great for me. Thanks again

Viewing 3 reply threads
  • You must be logged in to reply to this topic.