0
votes

I am facing issue to run the powershell script file in remote server. I am having the script file in remote server which is having 3 parameters. I need to call and execute this file from the lab server using Invoke-command.

ex: Invoke-Comamnd -session $s -Scriptblock{$filePath $arg1 $arg2 $arg3 }

Thanks in advance

1

1 Answers

0
votes

try something like $remoteCommand = "LocationOfScript\Script.ps1 -ParamOne $ValueOne - ParamTwo $ValueTwo"

Invoke-Command $remoteCommand