I have a large JSON file (vehicle data) from which I want to read 1 specific value (vehicle identification number, for example). So, following this answer, I have this code with debug output:
$json = Get-Content $responsefilepath | ConvertFrom-Json
Write-Host $json
Write-Host $json.values | Where-Object key -eq "coc_VIN"
- The first line puts my inputs file into an object;
- the second line outputs the content of my file:

- the third line should provide the value
YV1DZ8256D2390218, but it's just blank. - On the PS command line, this provides a nice table of all values:
Get-Content .\data\02-returned\sample.json | ConvertFrom-Json

- I would extend that command to filter on the desired key:
Get-Content .\data\02-returned\sample.json | ConvertFrom-Json | Where-Object key -eq "coc_VIN"
and again, that returns a blank line. Why?
