Switch statement

suggest change

Introduction

A switch statement tests a value against a list of conditions. Each match runs its action, and more than one condition can match unless you use break. The comparison is case-insensitive by default and is not limited to equality. Wildcard, regex, and script-block conditions are covered in the following pages. This avoids a long chain of if statements.

Remarks

This topic is documenting the switch statement used for branching the flow of the script. Do not confuse it with switch parameters which are used in functions as boolean flags.

Feedback about page:

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



Table Of Contents