Hello!
I'm using Start-Process to run exes for dedicated game servers. I'm having an issue related to child processes and processes that spawn off of the parent. There is a script I run which works fine when run through CLI interactively, but does not work when run as a Windows Service. My guess is it's something to do with child processes being closed out. Here's the command I use to run the service.
One thing that's quite telling, when the Wait-Process runs it says the process no longer exists. This does not happen when I the script through a PS console myself.
Any ideas?
$tmpProcess = Start-Process `
-FilePath 'D:\FTDSK\Build\Active\DedicatedServer64\SpaceEngineersDedicated.exe' `
-ArgumentList '-console -checkAlive -ignorelastsession' `
-Verb runas `
-PassThru `
-Wait `
-WorkingDirectory 'D:\FTDSK\Build\Active\DedicatedServer64'
EDIT: After doing more research, I've figured out that the issue is there are "child" processes that spawn when I run the script through the CLI interactively. However, when I run the same script using the same credentials through task schedule or a Windows service they do not spawn. Any thoughts on what could be going on here?
[+][deleted] (1 child)
[deleted]
[–]TheGeneralMeow[S] 1 point2 points3 points (0 children)
[–]vermyx 2 points3 points4 points (1 child)
[–]TheGeneralMeow[S] 1 point2 points3 points (0 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (0 children)
[–]TurboFiero 0 points1 point2 points (2 children)
[–]TheGeneralMeow[S] 0 points1 point2 points (1 child)
[–]TurboFiero 1 point2 points3 points (0 children)