I have a json output as list, I wanted to add a property in tags parameter using PowerShell
$json = @'
[
{
"tags": [],
"name": "[concat(parameters('factoryName'), '/Veh_Obj')]",
"properties": {
"type": "AzureDataLakeStoreFile",
}
}
]
'@
#$json = 'C:\workspace\cucumber_report.29776.json'
$obj = $json | ConvertFrom-Json
# Append new objects to the array.
$obj.tags += [pscustomobject] @{ name = 'newname1' }
# Convert back to JSON.
$obj | ConvertTo-Json -Depth 10 | Set-Content $json
But i am getting error as below The property 'tags' cannot be found on this object. Verify that the property exists and can be set. looks like issue is occurs only when I am passing JSON list, with normal json input this is working fine