If you want a good explanation of the difference between steps 1 and 2, just try the command line:
Remove-Variable i Trace-Command -Name TypeConversion -Expression {for($i=1; $i -le 1000000; $i++){}} -PSHost
And then:
Remove-Variable i Trace-Command -Name TypeConversion -Expression {for([int]$i=1; $i -le 1000000; $i++){}} -PSHost
This confirms @zdan's assumption that the difference is what is done in each loop. Step 1 and 6 are the names.
JPBlanc
source share