I basically want to do this:
switch($someString.ToLower()) { "y", "yes" { "You entered Yes." } default { "You entered No." } }
Like many other languages, PowerShell has commands for controlling the flow of execution within your scripts. One of those statements is the switch statement and in PowerShell, it offers features that aren't found in other languages.
switch($someString.ToLower()) { {($_ -eq "y") -or ($_ -eq "yes")} { "You entered Yes." } default { "You entered No." } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With