[powershell] How to create an ArrayList from an Array in PowerShell?

I've got a list of files in an array. I want to enumerate those files, and remove specific files from it. Obviously I can't remove items from an array, so I want to use an ArrayList. But the following doesn't work for me:

$temp = Get-ResourceFiles
$resourceFiles = New-Object System.Collections.ArrayList($temp)

Where $temp is an Array.

How can I achieve that?

This question is related to powershell

The answer is


Probably the shortest version:

[System.Collections.ArrayList]$someArray

It is also faster because it does not call relatively expensive New-Object.