Hi,
I'm trying to use CreateProcess to launch a powershell script from within my application.
I've used the Microsoft example (http://msdn.microsoft.com/en-us/library/ms682499(VS.85).aspx) to create the child process and redirect the standard out/in/err pipes.
The only issue left to solve is why the child process (powershell) do not terminate after executing the command.
If I execute the powershell process (with the command) cmd.exe it executes and exits, closing the process.
The only way of closing the powershell process right now is to run TerminateProcess on the handle, but that feels like a last resort.