Chapter 6. Flow control in scripts
Using the if/elseif/else statement | ||
The while loop | ||
The do/while loop | ||
The for loop | ||
The foreach loop | ||
Labels, break, and continue | ||
The PowerShell switch statement | ||
Flow control using cmdlets | ||
The value of statements | ||
Summary |
I may not have gone where I intended to go, but I think I have ended up where I needed to be. | ||
--Douglas Adams, The Long Dark Teatime of the Soul |
Previous chapters showed you how to solve remarkably complex problems in PowerShell using only commands and operators. You can select, sort, edit, and present all manner of data by composing these elements into pipelines and expressions. In fact, commands and operators were the only elements available in ...
Get Windows PowerShell in Action now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.