2

在 PowerShell 中,如何防止[System.Collections.ArrayList]$ArrayList=@() ; $ArrayList.Add("New thing")将新索引的值发送到主机?

谢谢!

4

1 回答 1

5

您可以将结果转换为 [void],或重定向到 null

[void]$ArrayList.Add("New thing")
$ArrayList.Add("New thing") > $nul
$ArrayList.Add("New thing") | out-null
于 2013-10-19T18:06:45.027 回答