$cmd = {
param([System.Array]$filestocopy = $(throw "need files"),
[bool]$copyxml)
if($copy)
#do stuff
}
$files = @("one","two","three")
invoke-command -session $s -scriptblock $cmd -argumentlist (,$files) $copyxml
错误:
Invoke-Command:找不到接受参数“True”的位置参数。
我搜索了高低,找不到如何将数组与参数列表中的内容一起传递。我试过了:(,$files,$copyxml)
、、(,$files),$copyxml
和(,$files) $copyxml
有没有办法做到这一点?