Skip to content

Instantly share code, notes, and snippets.

@quonic
Created August 16, 2024 23:47
Show Gist options
  • Save quonic/b5e8be08d48b47a483e8a6ce0355cc14 to your computer and use it in GitHub Desktop.
Save quonic/b5e8be08d48b47a483e8a6ce0355cc14 to your computer and use it in GitHub Desktop.
How to abuse a for loop to reset a value on each iteration
for ($($i = 0; $j = 0); $i -lt 3; $($i++; $j = 0)) {
# What is $j?
Write-Host "$j"
$j++
Write-Host "$j"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment