Infinite Loop

noun

say it: “IN-fih-nit LOOP” /ˈɪnfənɪt ˈlup/

A loop that never stops, because nothing inside it ever makes its condition change.

What is an infinite loop in PowerShell?

An infinite loop is a loop that never ends, because nothing inside it changes the answer to its condition. It fills the screen with the same line until you press Ctrl+C, which stops it without harm.

$fuel = 40
while ($fuel -lt 100) {
    "Fuel at $fuel%"      # nothing adds to $fuel
}
# Fuel at 40%
# Fuel at 40%   ...until Ctrl+C

In a sentence

  • “Sam forgot to add to $fuel, and his script fell into an infinite loop.”
  • “Press Ctrl+C to stop an infinite loop.”

Level: Novice · More PowerShell terms at this level

Updated

In other subjects