Powershell Execute remote exe with command line arguments on remote computer

后端 未结 5 1847
粉色の甜心
粉色の甜心 2020-12-01 12:10

I\'ve searched all over and tried different variations of commands, but I am still not there yet.

My goal is to run an exe that already resides on a remote machine a

5条回答
  •  醉话见心
    2020-12-01 12:49

    $sb = ScriptBlock::Create("$command")
    Invoke-Command -ScriptBlock $sb
    

    This should work and avoid misleading the beginners.

提交回复
热议问题