RosettaCodeData/Task/Associative-array-Creation/PowerShell/associative-array-creation-3.ps1
2026-04-30 12:34:36 -04:00

4 lines
210 B
PowerShell

$hashtable.foo = "bar"
$hashtable['bar'] = 42
$hashtable."a b" = 3.14 # keys can contain spaces, property-style access needs quotation marks, then
$hashtable[5] = 8 # keys don't need to be strings