I am very confused. I'm used to in most programming languages to where referencing a property in the dot notation (e.g. $object.AProperty) is the exact same thing as referencing it in what I'll call the "hashtable" notation (e.g. $object['code']).
However, I've got an Invoke-RestMethod request that is returning content from a page. If in debugging I output: $Object['code']
I get $null
And yet, if I output: $Object.code
I get the value that is actually within it, which is "200".
Why on earth would this happen?
I can work past this issue by using the other notation, but I'm so confused as to why it happens. I was surprised to find that in PowerShell, even the following is proper: $Object.$property
As a result, this is a non-issue for my code, but I'd like to understand what is happening.