| [ Web Proxy ] |
| Viewing: https://riptutorial.com/powershell/example/3795/switch-statement-with-casesensitive-parameter | [Back] [Original] |
[logo rip]
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.
| Web Proxy Viewer | New URL | Original Page |