PowerShell Parsing ArrayLists PowerShell Parsing ArrayLists powershell powershell

PowerShell Parsing ArrayLists


ArrayList.Add returns the index of the item added, and this goes into your output stream.

To prevent this side effect use this pattern:

$null = $checkedServices.Add($item.Text)-or-$checkedServices.Add($item.Text) | Out-Null