I need to get the index number for an item in array using the items value. I can't seem to see in the documentation how to achieve this.
$json = New-Object Chilkat.JsonObject
$jsonStr = "{ `"id`": 1, `"name`": `"A green door`", `"tags`": [`"home`", 22, `"green`"], `"price`": 125 }"
$success = $json.Load($jsonStr)
if ($success -ne $true) {
$($json.LastErrorText)
exit
}
# Get the "tags" array, which contains "home", 22, "green"
$tagsArray = $json.ArrayOf("tags")
if ($tagsArray -eq $null ) {
$("tags member not found.")
exit
}