Commands / Text and objects

ConvertFrom-Json

Parse JSON text

beginner Text and objects

ConvertFrom-Json
 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

ShellWhat you might type
bash / zshjq . data.json

More in From bash and From cmd.

Related commands