I am writing a function that returns an id, name pair.
I would like to do something like
$a = get-name-id-pair()
$a.Id
$a.Name
like is possible in javascript. Or at least
$a = get-name-id-pair()
$a["id"]
$a["name"]
like is possible in php. Can I do that with powershell?
I use this for keeping track of sites/directories when working on multiple domains. It is possible to initialise the array when declaring it rather than adding each entry separately:
You can also do this:
Not associative array, but equally as useful.
-Oisin
Will add also the way to iterate through hashtable, as I was looking for the solution and did not found one...
also
or
Yes. Use the following syntax to create them