Changes

Jump to: navigation, search

The Windows PowerShell 1.0 switch Statement

502 bytes added, 13:47, 14 May 2009
no edit summary
<table border="0" cellspacing="0" width="100%">
<tr>
<td width="20%">[[Windows PowerShell 1.0 Looping with do and while Statements|Previous]]<td align="center">[[Windows PowerShell 1.0 Essentials|Table of Contents]]<td width="20%" align="right">[[Windows PowerShell 1.0 Functions|Next]]</td>
<tr>
<td width="20%">Windows PowerShell 1.0 Looping with do and while Statements<td align="center"><td width="20%" align="right">Windows PowerShell 1.0 Functions</td>
</table>
<hr>
 
 
<google>BUY_WPS</google>
 
 
In the [[Windows PowerShell 1.0 Flow Control with if, else and elseif]] chapter of this book we looked at how to control program execution flow using the ''if'', ''else'' and ''elseif'' statements. Whilst these statement constructs work well for testing a limited number of conditions they quickly become unwieldy when dealing with larger numbers of possible conditions. To simplify such situations, Windows PowerShell (as with most other programming and scripting langauges) has inherited the ''switch'' statement from the C programming language. In this chapter we will explore the ''switch'' statement in detail. Those familiar with the ''switch'' statement from other programming languages might also be pleasantly surprised by a number of new ideas that the Windows PowerShell have added to this popular construct.

Navigation menu