davep
I apologize for the noob question: How would I translate something like this to powershell?
Code: Select all
for /l %X in (1,1,6) do ...
Code: Select all
PS C:\> 1,2,3,4,5,6 | foreach-object -process {$_*2}
2
4
6
8
10
12
#2 07 May 2009 18:07
Simon Sheppard
use the range operator
https://ss64.com/ps/syntax-arrays.html
Code: Select all
PS C:\> 1,2,3,(5..9) | foreach-object -process {$_*2}
#3 07 May 2009 18:42
davep
Ah, yes. Thank you. I also just found the range operator in "get-help array" Thanks again!