我想localhost
从字符串中删除,但以下命令不起作用。有什么想法为什么不呢?
选项1:
[string[]]$Servers = '"localhost","tbhserver"'
$Servers = $servers | Where-Object {$_ -ne "localhost"}
选项2:
[string[]]$Servers = '"localhost","tbhserver"'
$Servers
[System.Collections.ArrayList]$servers = $servers
$servers.Remove("localhost")