PowerShell: Join Array, Append
🛑 WARNING: Array type is optimized for not changing size. It has to recreate the array and is slow. The more items in a array, the slower it is to change size.
Append an Item
Use operator +=
to add a item to end of array.
$x = 1, 2, 3 # add a item "b" to the end $x += "b" $x
Join Arrays
use +
operator.
$a = 1,2 $b = 3,4,5 $a+$b
PowerShell: Array
- PowerShell: Array
- PowerShell: Array Sub-Expression Operator @(), Collection to Array
- PowerShell: Array and Types
- PowerShell: Nested Array, Multi-Dimensional Array
- PowerShell: Array, Get Item
- PowerShell: Array, Set Item
- PowerShell: Test If Collection Contains a Value
- PowerShell: Join Array, Append
- PowerShell: Filter Array
- PowerShell: Delete Array, Clear Array
- PowerShell: Array to String
- PowerShell: Array Methods
- PowerShell: Iterate Array