Issue Removing Items from a CheckedListBox

I have checkedListBox (used for removing VMWare Snapshots). I have a function that removes items when clicked, shown below. However, Only half of the checked items gets removed. What am I missing? Every index will get printed out, but only 2 of the 4 checked items gets removed.

$numChecked = $CHECKBOXLIST_Snapshots.CheckedIndices.Count if($numChecked -gt 0){ foreach($i in $CHECKBOXLIST_Snapshots.CheckedIndices) { start-sleep -Milliseconds 500 Write-Host "Number is" $i

$CHECKBOXLIST_Snapshots.Items.RemoveAt($i) }





  • Edited by mxalvis 14 hours 22 minutes ago
September 4th, 2015 12:26pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics