Access a hash table value by key.

suggest change

An example of defining a hash table and accessing a value by the key

$hashTable = @{
    Key1 = 'Value1'
    Key2 = 'Value2'
}
$hashTable.Key1
#output
Value1

An example of accessing a key with invalid characters for a property name:

$hashTable = @{
    'Key 1' = 'Value3'
    Key2 = 'Value4'
}
$hashTable.'Key 1'
#Output
Value3

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents