Simple Switch
suggest changeA switch statement compares one test value with multiple conditions and runs the action for each match. It can run more than one action. Matching is case-insensitive unless you pass -CaseSensitive.
Given the following switch…
switch($myValue)
{
'First Condition' { 'First Action' }
'Second Condition' { 'Second Action' }
}
'First Action' will be output if $myValue is set as 'First Condition'.
'Second Action' is output if $myValue is 'Second Condition'.
Nothing is output if $myValue matches neither condition.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents