The wikipedia API returns JSON that contains an element with the name *
. How can I access such a property in PowerShell?
Example:
$json = Invoke-RestMethod -Method Get -Uri 'https://en.wikipedia.org/w/api.php?action=parse&pageid=10000&prop=wikitext&format=json'
$json.parse.wikitext.* # fails
Error: "Missing property name after reference operator." So the asterisk is not recognized as a property name.
JSON excerpt:
{
"parse": {
"title": "Eiffel",
"pageid": 10000,
"wikitext": {
"*": "{{Wiktionary|Eiffel}}\n'''Eiffel''' ..."
}
}
}