按鍵訪問雜湊表值
定義雜湊表並通過金鑰訪問值的示例
placeholderCopy$hashTable = @{
Key1 = 'Value1'
Key2 = 'Value2'
}
$hashTable.Key1
#output
Value1
訪問具有屬性名稱的無效字元的鍵的示例:
placeholderCopy$hashTable = @{
'Key 1' = 'Value3'
Key2 = 'Value4'
}
$hashTable.'Key 1'
#Output
Value3