PowerShell dots in JSON

My, my. There's always more to learn about PowerShell, it seems.

It turns out that dotted property names in JSON payloads are somehow getting more popular than I knew, because they're used in all sorts of configuration systems.

Here's a quick example of how to do it. Just quote your property names in PoweShell!

PS > $t = '{ "hi.there" : "friend" }'
PS > $j = ConvertFrom-Json $t
PS > Write-Host $j."hi there"
friend

Happy parsing!

Tags:  powershell

Home