【发布时间】:2013-10-28 09:56:11
【问题描述】:
在 PowerShell 中,如何防止 [System.Collections.ArrayList]$ArrayList=@() ; $ArrayList.Add("New thing") 将新索引的值发送到主机?
谢谢!
【问题讨论】:
标签: arrays powershell arraylist indexing output
在 PowerShell 中,如何防止 [System.Collections.ArrayList]$ArrayList=@() ; $ArrayList.Add("New thing") 将新索引的值发送到主机?
谢谢!
【问题讨论】:
标签: arrays powershell arraylist indexing output
您可以将结果转换为 [void],或重定向到 null
[void]$ArrayList.Add("New thing")
$ArrayList.Add("New thing") > $nul
$ArrayList.Add("New thing") | out-null
【讨论】: