In Power Shell script, the for loop is part of the flow control group which consists of the while loop, for each loop, the do…while loop and etc.
In order to create a for loop in Power Shell followed this procedure:-
for ($i = 0; $i -lt 10; $i++) { $i }
Basically, if you are a programmer then the statement above will look familiar, the -lt within the for loop simply means less than. The loop above will produce a number from 0 to 9.
0 1 2 3 4 5 6 7 8 9
The power Shell flow loop has been often used in the power shell script language.