Start-Process And Wait For Parent Process Only


I’m using the PowerShell syntax:

The process being started is an installer, which installs a Windows service and then starts up that service, then the process stops. What’s happening is that my script is hanging indefinitely, even after the process completed successfully and the process has exited (as I can see in Task Manager. When I run it from a command line, without PowerShell, it’s done in under a minute). Apparently, it’s still waiting because there’s a child process which was spawned from the original process. How can I tell PowerShell to wait only for the initial process ($file) and not any children?



In the end, I decided to simply do it the .NETy way, even though I had preferred a Powershelly way of doing it. Code below is copied from

This way worked without issue.


Start-Process And Wait For Parent Process Only by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply