PowerShell - Control Flow
Identify the error in this PowerShell for loop:
for ($i=0; $i -lt 5; $i--) { Write-Output $i }Identify the error in this PowerShell for loop:
for ($i=0; $i -lt 5; $i--) { Write-Output $i }$i-- decreases $i, which will never reach 5, causing an infinite loop.$i++ to increase $i and eventually end the loop.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions