Search notes:
PowerShell: comma operator
Binary comma operator
The binary comma operator is used to create
arrays
:
$ary = $elem_one, $elem_two, $elem_three
Unary comma operator
There is also a unary comma operator which creates an array with one element only. Note that the comma needs to be placed
before
the element:
$ary = ,42
The unary comma operator might be used, for example, in
functions
to
return arrays
(such as
byte arrays
).
See also
operators
Index