10
10
#>
11
11
12
12
# <snippet00>
13
- # Create new hash table using PowerShell syntax
13
+ # Create new hash table using PowerShell syntax.
14
14
$OpenWith = @ {}
15
15
16
- # Add one element to the hash table using the Add method
16
+ # Add one element to the hash table using the Add method.
17
17
$OpenWith.Add (' txt' , ' notepad.exe' )
18
18
19
- # Add three eleements using PowerShell syntax three different ways
19
+ # Add three elements using PowerShell syntax three different ways.
20
20
$OpenWith.dib = ' paint.exe'
21
21
22
22
$KeyBMP = ' bmp'
23
23
$OpenWith [$KeyBMP ] = ' paint.exe'
24
24
25
25
$OpenWith += @ {' rtf' = ' wordpad.exe' }
26
26
27
- # Display hash table
27
+ # Display hash table.
28
28
" There are {0} in the `$ OpenWith hash table as follows:" -f $OpenWith.Count
29
29
' '
30
30
31
- # Display hashtable properties
31
+ # Display hashtable properties.
32
32
' Count of items in the hashtable : {0}' -f $OpenWith.Count
33
33
' Is hashtable fixed size? : {0}' -f $OpenWith.IsFixedSize
34
34
' Is hashtable read-only? : {0}' -f $OpenWith.IsReadonly
35
- ' Is hashtabale synchronised? : {0}' -f $OpenWith.IsSynchronized
35
+ ' Is hashtable synchronised? : {0}' -f $OpenWith.IsSynchronized
36
36
' '
37
37
' Keys in hashtable:'
38
38
$OpenWith.Keys
@@ -46,17 +46,17 @@ This script produces the following output:
46
46
47
47
There are 4 in the $OpenWith hash table as follows:
48
48
49
- Name Value
50
- ---- -----
51
- txt notepad.exe
52
- dib paint.exe
53
- bmp paint.exe
54
- rtf wordpad.exe
49
+ Name Value
50
+ ---- -----
51
+ txt notepad.exe
52
+ dib paint.exe
53
+ bmp paint.exe
54
+ rtf wordpad.exe
55
55
56
56
Count of items in the hashtable : 4
57
57
Is hashtable fixed size? : False
58
58
Is hashtable read-only? : False
59
- Is hashtabale synchronised? : False
59
+ Is hashtable synchronised? : False
60
60
61
61
Keys in hashtable:
62
62
txt
@@ -70,4 +70,4 @@ paint.exe
70
70
paint.exe
71
71
wordpad.exe
72
72
#>
73
- # </snippet00>
73
+ # </snippet00>
0 commit comments