O'Reilly logo

Mastering Windows PowerShell Scripting by Brenton J.W. Blawat

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

Looping structures

PowerShell provides a variety of looping structures for evaluating and executing objects. Loops are helpful in situations where you need to take in an array of objects and process the individual values in the array. Subsequently, loops are also helpful in situations where you need to wait for a specific value within an array before proceeding in the script.

There are four main looping structures in PowerShell. These looping structures include Do/While, Do/Until, ForEach, and For. The Do/While looping structure is used to execute a task when a value doesn't equal a specific value. The inverse of this looping structure is Do/Until, where it will keep looping the structure until a value equals a specific value. ForEach is a looping ...

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