QuickBlog: How to remove Array element (or range) with PowerShell…

As I look for a way that I could eliminate a single or a range of elements, I found many C# .NET code on how do it. But only one of the answer in many caught my eye. This answer was “System.Collections.ObjectModel.Collection“. This help me search deeper and of course found that there’s a couple of methods I could use if I create my Array as an ArrayList type.

This way I got available two methods I can use: .RemoveAt( element# ) and .RemoveRange( AtElement# , HowMany# ) .

So, in scenario where you want to remove some elements of the array in PowerShell try using the following typed accelerator[System.Collections.ArrayList] .