PowerShell : retrieve JSON object by variable value

Question:


I’d like that to print true but it doesn’t. I know $json.key would work. Can this be done?

Answer:

If you know that $json.key would work, then why you’re switching from dot to square brackets?
All these will work:

Source:

PowerShell : retrieve JSON object by variable value by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply