As a best practice, you generally avoid using the ElseIf type of construction from either VBScript or Windows PowerShell because there is a better way to write the same code.
In VBScript, you would use the Select Case statement to evaluate a condition and select one outcome from a group of potential statements. In the DemoSelectCase.vbs script, the value of the variable a is assigned the value of 2. The Select Case statement is used to evaluate the value of the variable a. The syntax is shown here:
Select Case testexpression
The test expression that is evaluated is the variable a. Each of the different cases contains potential values for the test expression. If the value of the variable a is equal to 1, the code Wscript.Echo ...