PowerShell: Array, Set Item
Set Array Element (syntax)
$x = 1, 2, 3 $x[0] = "b" Write-Host $x # b 2 3
SetValue (method)
SetValue(val, index)
$x = 1, 2, 3 $x.SetValue("b",0) Write-Host $x # b 2 3
Delete Item
It's not easy to delete array item in PowerShell.
Array data structure is not designed to change size.
Instead of delete, just replace the item by $null
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 (Where-Object)
- PowerShell: Delete Array, Clear Array
- PowerShell: Array to String
- PowerShell: Array Methods
- PowerShell: Iterate Array