Chapter 20. Adding logic and loops

Up to this point, I don’t consider anything that we’ve done so far to be “scripting.” It depends on your definition of the word, of course, but to me scripting is a kind of programming, with formal constructs that define logic, repetition, and so forth. You can do a lot in PowerShell without that stuff. But the time will come when you will need to write a script that can make logical decisions, and you’ll start to move beyond running commands and moving into simple scripts.

The goal in this chapter is to let you experience some of PowerShell’s major scripting constructs for logic and repetition, so that you’ll be prepared to use these elements when the time comes.

20.1. Automating complex, multi-step processes ...

Get Learn Windows PowerShell in a Month of Lunches 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.