$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
Error:
Invoke-Command : A positional parameter cannot be found that accepts argument 'True'.
I have searched high and low and cannot find how to pass in an array along with something in a argumentlist. I have tried: (,$files,$copyxml)
, (,$files),$copyxml
, and (,$files) $copyxml
Is there a way to do this?