I’ve tried:
Invoke-Command -ComputerName RemotePC -filepath C:myscript.ps1 -ArgumentList param1, switchparam:$true Invoke-Command -ComputerName RemotePC -filepath C:myscript.ps1 -ArgumentList param1, $true Invoke-Command -ComputerName RemotePC -filepath C:myscript.ps1 -ArgumentList param1, switchparam
But all fail with a positional parameter cannot be found
Can this be done?
submitted by /u/davesbrown
[link] [comments]
The post How to pass switch parameter through Invoke-Command? appeared first on How to Code .NET.