Pipeline Variable Access Property by Variable

Welcome Forums General PowerShell Q&A Pipeline Variable Access Property by Variable

Viewing 2 reply threads
  • Author
    Posts
    • #209625
      Participant
      Topics: 9
      Replies: 19
      Points: 96
      Rank: Member

      I tried for hours to get this to work 🙂 any help would be greatly appreciated as it would massively speed up merge operations.

      Why is $_.$something or $_.$($something) a no go??

      • This topic was modified 10 months, 2 weeks ago by Nicholas J Crooks.
      • This topic was modified 10 months, 2 weeks ago by Nicholas J Crooks.
      • This topic was modified 10 months, 2 weeks ago by Nicholas J Crooks.
      • This topic was modified 10 months, 2 weeks ago by Nicholas J Crooks. Reason: Forgot to include the method I am using to capture the missing/destination properties
    • #209643
      Participant
      Topics: 9
      Replies: 19
      Points: 96
      Rank: Member

      Due to the time crunch here’s what I did (repeating for each field I needed)

    • #209718
      Participant
      Topics: 6
      Replies: 667
      Points: 97
      Helping Hand
      Rank: Member

      It’s simply because the dot notation is expecting a string after the dot, not a variable.  You can do what you want by simply providing a string that contains a variable to resolve.

      IE

Viewing 2 reply threads
  • The topic ‘Pipeline Variable Access Property by Variable’ is closed to new replies.