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 Friday, September 04, 2015 4:44 PM