title: PowerShell loop range with steps
body: <p>I'm trying to move from BATCH into PowerShell and I am trying to convert my own scripts.</p>
  
  <p>My problem is with ranges in loop: my original BATCH script was like</p>
  
  <pre><code>   for /L %%U in (123,2,323) do ECHO %%U
  </code></pre>
  
  <p>and will print </p>
  
  <pre><code>123
  125
  127
  ...
  </code></pre>
  
  <p>with Powershell a range would be 123..323, thus</p>
  
  <pre><code>123..323 | % {Echo $_ }
  </code></pre>
  
  <p>Will give me </p>
  
  <pre><code>123
  124
  125
  ...
  </code></pre>
  
  <p>Is there a way to set a range with a step that is different than 1? All the examples I find either list all the numbers (I have hundreds...) or use the two points between the numbers.</p>