I have a json File... Here is an excerpt:
{
"stuff1": "thisStuff1",
"stuff2": "this Stuff2",
"manifest": {
"junk1": "This Junk 1",
"build-version": "2.0.15299",
"junk2": "This Junk 2",
}
I can't change or modify the json file. I need the Version number in "build-Version"
I am writing a Powershell script to find the current version out of the json file.
I load in the Json file like this:
$json = (Get-Content "myPath.myJson.json" -Raw) | ConvertFrom-Json
I can get the Manifest like this:
$version = $json[0].manifest[0]
Write-Host $version
What I need is the Build Number, but since the Json file was built with dashes to connect names I get an error when I try:
$version = $json[0].manifest[0].build-version
Write-Host "The Version" $version
This question seems close: How to deserialize a property with a dash (“-”) in it's name with NewtonSoft JsonConvert?
but I do not know the Powershell commands to deserialize