O'Reilly logo

Learn Windows PowerShell in a Month of Lunches by Don Jones

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required