8,330 questions
Hi,
You can use ConvertFrom-Json cmdlet to convert json data.
convertfrom-json
e.g.
$JsParent = @'
{"type": "AzureKeyVaultSecret", "store": {
"referenceName": "AzureKeyValut1",
"type": "LinkedServiceReference"
}, "secretName": "datasetls"}
'@
$X = New-Object PsObject -Property @{Parent = $JsParent}
#using pipeline
$X.Parent | ConvertFrom-Json
#In your case with JObject, pls try below:
#$X.Parent.ToString() | ConvertFrom-Json
#or cmdlet
ConvertFrom-Json -InputObject $X.Parent
#ConvertFrom-Json -InputObject $X.Parent.ToString()
or you can refer to this link:
powershell-accessing-a-jarray-inside-a-jobject