YZlat
asked on
Adding items to ArrayList prints ArrayList index to the screen
When I add items to ArrayList, Powershell also outputs the ArrayList index to the screen. How do i prevent that from happening?
Here is my code:
Here is my code:
$alComputers=new-object Collections.ArrayList
foreach ($child in $ou.psbase.Children) {
if ($child.ObjectCategory -like '*computer*') {
$alComputers.Add($child)
}
}
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER