PowerTip: Use PowerShell to Create Hash Table to Hold Lowercase Letters

Doctor Scripto

Summary: Use Windows PowerShell to create a hash table that holds all ASCII lowercase letters.

Hey, Scripting Guy! Question How can I use Windows PowerShell to create a hash table that holds all lowercase ASCII letters?

Hey, Scripting Guy! Answer Create an empty ordered dictionary, and then use the add method to add the numbers 97-122
           as keys and the [char] associated with the number as the value, for example:

$a = [ordered]@{}

97..122 | foreach-object {$a.Add($_,[char]$_)}

0 comments

Discussion is closed.

Feedback usabilla icon