I have a json string as given below.
$json=' {
"code": 0,
"ms": "success",
"dt": {
"st": 1,
"mns": [
"@{name=product 1 - w; att=response_time; st=1; time=2020-08-21T14:18:03-0400; locations=System.Object[]; attN=RESPONSETIME; mt=PORT; attL=Response Time; attribute_value=67; unit=ms; monitor_id=12}",
"@{name=product 2 - w; att=response_time; st=1; time=2020-08-21T14:18:03-0400; locations=System.Object[]; attN=RESPONSETIME; mt=PORT; attL=Response Time; attribute_value=70; unit=ms; monitor_id=23}",
"@{name=product 3 - w; att=response_time; st=1; time=2020-08-21T14:18:03-0400; locations=System.Object[]; attN=RESPONSETIME; mt=PORT; attL=Response Time; attribute_value=66; unit=ms; monitor_id=24}",
"@{st=5; name=product 4 - w; mt=PORT; monitor_id=35}"
],
"gd": "12345",
"gn": "group_name 5 - w"
}
}'
I tried to read the status value given under "mns" using the below code
$jsonobject= ConvertFrom-Json -InputObject $json
foreach ($mn in $jsonobject.dt.mns)
{
$mndata=ConvertFrom-StringData -StringData $mn
Write-Host $mndata["st"]
}
But i'm not able to retrieve the value of $mndata["st"] .

Invoke-WebRequest/Invoke-RestMethod? Please show us the exact command you run (sans URL) to get that exact JSON string