For example, given a list 1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8 and a number 4, it returns a list of list with length of 4, that is (1, 2, 3, 4), (5, 6, 7, 8),
1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8
(1, 2, 3, 4), (5, 6, 7, 8),
Clear-Host $s = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18 $count = $s.Length $split = $count/2 $split -- $b = $s[0..$split] $split ++ $a = $s[$split..$count] write-host "first array" $b write-host "next array" $a #clean up Get-Variable -Exclude PWD,*Preference | Remove-Variable -EA 0