I want to retrieve value of a field present in json object. The filed name has dots and hyphen.
For eg:
$json = @"
{
"Stuffs":
{
"Name.new-name": "Darts",
"Type": "Fun Stuff"
}
}
"@
How can I get the value Darts
?
I tried some approaches like
$x = $json | ConvertFrom-Json
$x.Stuffs.(Name.new-name)
But it doesn't work.
Try this
$x.Stuffs.'Name.new-name'