更新时间:2022-12-19 22:49:30
您可以尝试使用Enter-PSSession
打开远程会话,然后使用不带Invoke-Command
You could try to open a remote-session with Enter-PSSession
and then use the cmdlet Start-Process
without Invoke-Command
您也可以像这样& "C:\Program Files (x86)\Test\TestUploadManager\TestUploadManager.exe" -cl
(在远程会话中)运行程序
You could also run the program like this & "C:\Program Files (x86)\Test\TestUploadManager\TestUploadManager.exe" -cl
(within the remote-session)
最后,您应该使用Exit-PSSession
另一种可能性是本地"运行脚本.编写脚本,就像在本地计算机上运行脚本一样.将其复制到可访问的共享.然后使用远程处理方法在计算机上运行脚本.
Another possibility is to run the script "locally". Write the script as you would run it on a local machine. Copy it to an accessable share. Then use a remoting method to run the script on the machine.