# for Loop

*noun*

say it: **“FOR LOOP”** **/ˈfɔr ˈlup/**

A loop that counts from a start to a finish, taking one step, such as adding or taking away one, each time round.

## What is a **for loop** in PowerShell?

A **for loop** counts. Its parentheses hold three parts, separated by semicolons: a start that runs once, a test checked before every pass, and a step taken after each one. `$n--` takes one off; `$n++` adds one.

```powershell
for ($n = 3; $n -ge 1; $n--) {
    "T-minus $n"
}
'Liftoff!'
# T-minus 3
# T-minus 2
# T-minus 1
# Liftoff!
```

## In a sentence

- “The launch countdown is a **for loop** that goes from 5 down to 1.”
- “Sam used a **for loop** with $day += 7 to visit each week of the month.”

Level: Apprentice · [More PowerShell terms at this level](https://www.ask-codey.com/glossary?category=powershell&level=2)

Updated: November 10, 2026

## In other subjects

- [for Loop in C#](https://www.ask-codey.com/glossary/for-loop-c-sharp)
- [for Loop in Java](https://www.ask-codey.com/glossary/for-loop-java)
- [for Loop in JavaScript](https://www.ask-codey.com/glossary/for-loop-javascript)
- [for Loop in Python](https://www.ask-codey.com/glossary/for-loop)
- [for Loop in Unix](https://www.ask-codey.com/glossary/for-loop-unix)

Source: https://www.ask-codey.com/glossary/for-loop-powershell
