Last active
August 18, 2019 07:56
-
-
Save PlagueHO/56eaf0542ae584e21e1c189c26623594 to your computer and use it in GitHub Desktop.
PowerShell example using a hash table to map colour name to value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$colourName = 'green' | |
$colourMap = @{ | |
red = 0xFF0000 | |
green = 0x00FF00 | |
blue = 0x0000FF | |
white = 0xFFFFFF | |
} | |
$colourValue = $colourMap[$colourName] | |
return $colourValue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment