Hi!
I want to add an object to an array withing a loop. Can anyone tell me how to increment the name of the object?
i.e n the following code I the first time it runs I want it to create an object called $Array_object1, the next time $Array_Object2 etc.
$Array = @() $count = 1 Foreach($i) { $Array_object = New-Object System.Object $Array_object | Add-Member -type NoteProperty -Name Instance -Value $i $Array += $Array_object $count ++ }
Thanks,
Zoe