2

I am using PSExec, which is called in one of my powershell scripts, to remotely run an executable on a remote machine and wait until it's execution finishes (using the -Wait flag on the Start-Process cmd that starts PSExec).

For some reason, the executable finishes properly (process is not running anymore on the remote computer, all output files it creates are present, all log files from that executable say everything went ok and that it finished properly without errors), but PSExec never seems to exit. I have redirected PSExec's std and err outputs to 2 files, and they only show part of what they should if the execution had indeed went smoothly without hanging.

Now, I use PSExec at several places in that powershell script, and this only happens in one specific instance. The only different thing I can think about is that that executable takes about 8h to complete, whereas all the other places I use PSExec the remote executable/script take maximum 20-30min to complete.

Is there some kind of timeout associated to PSExec? Am I missing a flag or something?

For reference, here is the powershell lines where I actually call PSExec and that is causing this issue:

$PSExecRunTestsParams = "\\$parsedTestRunnerVM -h -n 30 -accepteula -u $user -p $pass -w $localTestRunnerDirPath $localTestRunnerExePath 3"
Start-Process -FilePath $PSExecPath -ArgumentList $PSExecRunTestsParams -Wait -RedirectStandardOutput $tempStdOutLog -RedirectStandardError $tempStdErrLog

It is to note that the powershell lines following this never actually get called either.

Choub890
  • 1,163
  • 1
  • 13
  • 27
  • 1
    Could it be possible that the script is stuck waiting on standard input? I found this while looking for an answer: http://serverfault.com/q/437504/340381 – Roujo Oct 19 '16 at 19:39

0 Answers0