Lazy Diary @ Hatena Blog

PowerShell / Java / miscellaneous things about software development, Tips & Gochas. CC BY-SA 4.0/Apache License 2.0

Entries from 2017-11-13 to 1 day

Convert deeply nested hash or array to JSON with ConvertTo-Json

Context You can read a JSON file like below with ConvertFrom-Json, and write with ConvertTo-Json properly. PS > Get-Content ./foo.json { "outerHash": { "innerHash": { "key": "value" } } } PS > Get-Content ./foo.json | ConvertFrom-Json | Co…