Summary: Retrieve specific items from a Windows PowerShell hash table.
How can I use Windows PowerShell t retrieve specific values associated with specific keys in a hash table?
Suppose you have a hash table such as this:
$d = @{a=28;b=29;c=30}
The keys and values associated with the hash table are:
PS C:\> $d
Name Value
---- -----
c 30
b 29
a 28
You can retrieve by name (key) property by using the item method or by directly supplying the key.
Note Key names are letters, and to retrieve via the names, you must enclose the letters in quotation marks.
PS C:\> $d.Item('a')
28
PS C:\> $d['a']
28