CloudBolt supports running scripts on remote servers, including Windows PowerShell scripts.
Symptoms:
During the process of running the remote script, the job fails with an error similar to:
Process 1048 completed on guest with error: (vim.vm.guest.ProcessManager.ProcessInfo) { dynamicType = <unset>, dynamicProperty = (vmodl.DynamicProperty) [], name = 'powershell.exe', pid = 1048L, owner = 'Administrator', cmdLine = '"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" C:\\Windows\\Temp\\03cc3978aafa493881a6c75ec1fef19c.ps1 10.50.22.230 > C:\\Windows\\Temp\\c2_stdout_tmp 2> C:\\Windows\\Temp\\c2_stderr_tmp', startTime = 2015-03-26T18:53:36Z, endTime = 2015-03-26T18:53:45Z, exitCode = 1 }
Solutions:
There are a myriad of causes for this error. The best first step in troubleshooting is to get console on your Windows server and run the command exactly as seen in the error output where you see "cmdLine = ". In the above case that would mean opening a PowerShell prompt and running this (notice that the surrounding single quotes have been removed, but the double quotes stay):
"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" C:\\Windows\\Temp\\03cc3978aafa493881a6c75ec1fef19c.ps1 10.50.22.230 > C:\\Windows\\Temp\\c2_stdout_tmp 2> C:\\Windows\\Temp\\c2_stderr_tmp
One solution to consider is setting the Execution Policy in the Windows template to "Unrestricted". This can be done in PowerShell with `Set-ExecutionPolicy Unrestricted`.
1 Comments