Switch Statement with CaseSensitive Parameter
suggest change-CaseSensitive makes the match case-sensitive. Without it, string matches ignore case.
Example:
switch -CaseSensitive ('Condition')
{
'condition' {'First Action'}
'Condition' {'Second Action'}
'conditioN' {'Third Action'}
}
Second Action
The second action is the only action executed because it is the only condition that exactly matches the string 'Condition' when accounting for case-sensitivity.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents