# Until Something Is True: \`while\`, \`do\` and \`for\`

while repeats steps as long as a condition is true, do runs them at least once and checks at the end, which suits trying again up to three times, and for counts from a start to a finish one step at a time.

![Cheat sheet for the lesson Until Something Is True: \`while\`, \`do\` and \`for\`: while repeats steps as long as a condition is true, do runs them at least once and checks at the end, which suits trying again up to three times, and for counts from a start to a finish one step at a time.](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/7c55996e80454c0bac1a0d1b6362645f.webp)

- Category: PowerShell
- Level: Apprentice
- Tags: do-until-loop, for-loop, infinite-loop, powershell, start-sleep, while-loop
- Updated: November 10, 2026

Source: https://www.ask-codey.com/cheat-sheets/powershell-while-and-for-cheat-sheet
