ConvertFrom-Json
Parse JSON text
Get-Content -Path .\data.json -Raw | ConvertFrom-Json
- Works on
- WindowsLinuxmacOS
- PowerShell
- 5.1 and later
- Reference
- Microsoft Learn: ConvertFrom-Json
The reverse of ConvertTo-Json. Use -Raw with Get-Content so the file is one string, not an array of lines.
Try this
'{ "Name": "Ada" }' | ConvertFrom-Json
Coming from another shell
| Shell | What you might type |
|---|---|
| bash / zsh | jq . data.json |
More in From bash and From cmd.