Switch Statement with CaseSensitive Parameter

suggest change

The -CaseSensitive parameter enforces switch statements to perform exact, case-sensitive matching against conditions.

Example:

switch -CaseSensitive ('Condition')
{ 
  'condition'   {'First Action'}
  'Condition'   {'Second Action'} 
  'conditioN'   {'Third Action'}  
}

Output:

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.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents