I am trying to use PowerShell to extract value from JSON object, I have the following JSON:
{
\"$schema\": \"http://schema.management.azure.com/schemas/2
I don't know why, but the approach from message above don't work for me. But works just getting key that you need by key after "ConvertFrom-Json" command, e.g.:
$yourVariable = (Get-Content 'yourJsonFilePath.json' | ConvertFrom-Json).clusterStorageAccountName
Use the Get-Content
cmdlet to read the file, convert it using the ConvertFrom-Json
cmdlet and just access the property you want:
$yourVariable = (Get-Content 'yourJsonFilePath.json' | ConvertFrom-Json).parameters.clusterStorageAccountName.value