Created
February 28, 2018 19:26
-
-
Save Sambardo/6201cea224385a1179f84caf8289d6ec to your computer and use it in GitHub Desktop.
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
switch -casesensitive ("hello") #makes it a -ceq | |
{ | |
"HELLO" {write-host "Uppercase" -ForegroundColor Magenta} | |
"hello" {write-host "lowercase" -ForegroundColor green} | |
"h*" {write-host "wildcard" -ForegroundColor Magenta} | |
} | |
switch -wildcard ("hello") #makes it a -like | |
{ | |
"HELLO" {write-host "Uppercase" -ForegroundColor Magenta} | |
"hello" {write-host "lowercase" -ForegroundColor green} | |
"h*" {write-host "wildcard" -ForegroundColor Magenta} | |
} | |
switch -wildcard -CaseSensitive ("hello") #makes it a -clike | |
{ | |
"HELLO" {write-host "Uppercase" -ForegroundColor Magenta} | |
"hello" {write-host "lowercase" -ForegroundColor green} | |
"h*" {write-host "wildcard" -ForegroundColor Magenta} | |
} | |
switch -regex ("hello") #makes it a -match | |
{ | |
"\w{5}" {write-host "5 characters" -ForegroundColor Magenta} | |
"\w{6}" {write-host "6 characters" -ForegroundColor green} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment