Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

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

$
0
0

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]$_)}


Viewing all articles
Browse latest Browse all 3333

Trending Articles