You can use commas to create arrays in PowerShell.
PS c:powershell> $nums =2,0,1,2
PS c:powershell> $nums
2
0
1
2
For a sequential array of numbers, you can use a faster method
PS c:powershell> $nums =1..5
PS c:powershell> $nums
1
2
3
4
5
Polymorphism of arrays
Like a variable. If the type of an element in an array is a weak type, the default can store different types of values.
PS c:powershell> $array = 1, "2012 End of the World" ([System.guid]::newguid ()), (get-date)
PS c:powershell> $array
1
2012 World Doomsday
Guid
----
06a88783-a181-4511-9e41-2780ecbd7924
displayhint:datetime
Date : 2011/12/9 0:00:00
Day : 9
dayofweek : Friday
dayofyear : 343
Hour:
Kind: local
millisecond:910
Minute: Month :
Second :
Ticks : 634590369459101334
TimeOfDay : 14:15:45.9101334 year:
DateTime : December 9, 2011 14:15:45
Empty arrays and group of cell primes
Empty array
PS c:powershell> $a =@ ()
PS c:powershell> $a-is [array]
True
PS c:powershell> $a. Count
0
An array of 1 elements
PS c:powershell> $a =, "Moss"
PS c:powershell> $a-is [array]
True
PS c:powershell> $a. Count
1