Introduction
The range operator (..) helps you create a list of numbers quickly without typing each one.
$start..$end
1..510..7$a = 3; $b = 6; $a..$b
$numbers = 1..5 foreach ($num in $numbers) { Write-Output "Number: $num" }
1..5 produce?.. creates a sequence of numbers from the first number to the second number.5..1 which creates a descending list from 5 down to 1.1..3 | ForEach-Object { $_ * 2 }1..3 produces 1, 2, 3 which are piped one by one.5..1..1
.. twice in a row, making ..1..1 which is invalid... between two numbers, not three dots or step values.2..10 creates numbers 2 to 10. Filtering with Where-Object { $_ % 2 -eq 0 } keeps only even numbers.Pass the test and this pattern moves unknown