Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1 @@
$hashtable = @{}

View file

@ -0,0 +1,4 @@
$hashtable = @{
"key1" = "value 1"
key2 = 5 # if the key name has no spaces, no quotes are needed.
}

View file

@ -0,0 +1,4 @@
$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

View file

@ -0,0 +1,20 @@
# Case insensitive keys, both end up as the same key:
$h=@{}
$h['a'] = 1
$h['A'] = 2
$h
Name Value
---- -----
a 2
# Case sensitive keys:
$h = New-Object -TypeName System.Collections.Hashtable
$h['a'] = 1
$h['A'] = 2
$h
Name Value
---- -----
A 2
a 1

View file

@ -0,0 +1,2 @@
$hashtable.key1 # value 1
$hashtable['key2'] # 5

View file

@ -0,0 +1,4 @@
$obj = [PSCustomObject]@{
"key1" = "value 1"
key2 = 5
}