How to create an ArrayList from an Array in PowerShell?

后端 未结 2 1881
孤独总比滥情好
孤独总比滥情好 2021-02-01 05:36

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

2条回答
  •  时光说笑
    2021-02-01 06:07

    Probably the shortest version:

    [System.Collections.ArrayList]$someArray
    

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

提交回复
热议问题