You can’t remove elements from a .NET Array object. You can either use another type of collection (such as an ArrayList), or you can filter the elements and assign them to a new array object (even if it’s in the same variable.) For example:
You can do some funky stuff with multiple assignment and recursion to remove an element.
Removing based on what the element is.
`
function remove-item-list ($item,[array]$chckd_list=@(),[array]$list=(throw"the item $item was not in the list"))
{ if ($list.length -lt 1 ) { throw "the item $item was not in the list" }