Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

How to pass switch parameter through Invoke-Command?

$
0
0

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.


Viewing all articles
Browse latest Browse all 8793