Link to home
Start Free TrialLog in
Avatar of YZlat
YZlatFlag for United States of America

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:
 
$alComputers=new-object Collections.ArrayList
foreach ($child in $ou.psbase.Children) { 
    	if ($child.ObjectCategory -like '*computer*') { 
		$alComputers.Add($child)
	} 
}

Open in new window

SOLUTION
Avatar of soostibi
soostibi
Flag of Hungary image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of YZlat

ASKER

Thanks a bunch!