如何修复虚拟机上的 psexec 而不是 运行 PowerShell 脚本?

How to fix psexec not running PowerShell script on VM?

我正在使用 PsExec 运行 VM 上的 PowerShell 脚本。我这样执行 psexec

psexec \ip -c -i -u Admin -p password PowerShell C:\Path to PowerShellscript on computer

PowerShell 运行s 并且它在 VM 上打开但立即关闭。它在我的计算机上的 cmd 中给了我这条消息

PowerShell.exe exited on ip with error code 1

我该如何继续解决这个问题,以便我可以 运行 将我计算机上的 PowerShell 脚本安装到 VM 上?

我在执行 psexec 时删除了 -c,这似乎让它起作用了。