简体   繁体   English

如何修复psexec在VM上未运行PowerShell脚本的问题?

[英]How to fix psexec not running PowerShell script on VM?

I am using PsExec to run a PowerShell Script on a VM. 我正在使用PsExec在VM上运行PowerShell脚本。 I execute psexec like this 我这样执行psexec

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

PowerShell runs and it opens on the VM but immediately closes. PowerShell运行,并且在VM上打开,但立即关闭。 It gives me this message in cmd on my computer 它在我的计算机上以cmd的形式显示了此消息

PowerShell.exe exited on ip with error code 1

How do I proceed to fix this so I can run the PowerShell script that is on my computer onto the VM? 如何继续解决此问题,以便可以将计算机上的PowerShell脚本运行到VM上?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM