Blog Archives

Adding elements to a list(pshell)

Adding elements to an array using += actually creates a new array with the elements from the original array and adds the new element to it. A better practice is to create a list instead: $outItems = New-Object System.Collections.Generic.List[System.Object] Adding

Posted in array, howto, powershell