Skip to content

Fix typos in PS script #10124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@
#>

#<snippet00>
# Create new hash table using PowerShell syntax
# Create new hash table using PowerShell syntax.
$OpenWith = @{}

# Add one element to the hash table using the Add method
# Add one element to the hash table using the Add method.
$OpenWith.Add('txt', 'notepad.exe')

# Add three eleements using PowerShell syntax three different ways
# Add three elements using PowerShell syntax three different ways.
$OpenWith.dib = 'paint.exe'

$KeyBMP = 'bmp'
$OpenWith[$KeyBMP] = 'paint.exe'

$OpenWith += @{'rtf' = 'wordpad.exe'}

# Display hash table
# Display hash table.
"There are {0} in the `$OpenWith hash table as follows:" -f $OpenWith.Count
''

# Display hashtable properties
# Display hashtable properties.
'Count of items in the hashtable : {0}' -f $OpenWith.Count
'Is hashtable fixed size? : {0}' -f $OpenWith.IsFixedSize
'Is hashtable read-only? : {0}' -f $OpenWith.IsReadonly
'Is hashtabale synchronised? : {0}' -f $OpenWith.IsSynchronized
'Is hashtable synchronised? : {0}' -f $OpenWith.IsSynchronized
''
'Keys in hashtable:'
$OpenWith.Keys
Expand All @@ -46,17 +46,17 @@ This script produces the following output:

There are 4 in the $OpenWith hash table as follows:

Name Value
---- -----
txt notepad.exe
dib paint.exe
bmp paint.exe
rtf wordpad.exe
Name Value
---- -----
txt notepad.exe
dib paint.exe
bmp paint.exe
rtf wordpad.exe

Count of items in the hashtable : 4
Is hashtable fixed size? : False
Is hashtable read-only? : False
Is hashtabale synchronised? : False
Is hashtable synchronised? : False

Keys in hashtable:
txt
Expand All @@ -70,4 +70,4 @@ paint.exe
paint.exe
wordpad.exe
#>
#</snippet00>
#</snippet00>