【发布时间】:2010-01-27 17:57:10
【问题描述】:
有没有办法抑制 ArrayList 的返回值(=Index) 在 Powershell 中(使用 System.Collections.ArrayList)还是应该使用 另一个班级?
$myArrayList = New-Object System.Collections.ArrayList($null)
$myArrayList.Add("test")
Output: 0
【问题讨论】:
-
虽然这里提供的所有选项都有效,但我个人选择 [void] 的原因很简单:需要速度 :) Measure-Object 是您的朋友。 (有一篇关于这些东西的速度的不错的博客文章,但我暂时找不到,抱歉)
标签: .net powershell arraylist