When I package a .ps1 into a silent .exe, launching the .exe from a command prompt the .exe exits immediately while the script is still running in the background. Not sure if this is by design or if I supposed to configure the .exe differently. Is there anyway to keep the .exe running until the script finishes?
This was tested with a simple script that creates some files and having a 20 second pause in the script. When you launch .exe in command prompt the .exe immediately exits but the script is still running.
PS Studio .EXE exits while script is still running in the background
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: PS Studio .EXE exits while script is still running in the background
Packaging a .ps1 using the silent engine in powershell studio.
Re: PS Studio .EXE exits while script is still running in the background
The silent engine has no output. What is it you are looking to happen?
If you want the EXE to wait then don't use the silent engine.
See: https://www.sapien.com/blog/2019/07/24/ ... able-file/
If you want the EXE to wait then don't use the silent engine.
See: https://www.sapien.com/blog/2019/07/24/ ... able-file/
Re: PS Studio .EXE exits while script is still running in the background
I agree that the silent engine has no output. When the .exe is launched via CMD I would like to keep the console busy while the script process is running. Anyway to accomplish this?
Re: PS Studio .EXE exits while script is still running in the background
Don't use the silent engine. Read the link I posted which will give you all of the options for the different engines and how to use them.
The point of a silent engine is that it has no console at all so there is no way to freeze the console.
The point of a silent engine is that it has no console at all so there is no way to freeze the console.
Re: PS Studio .EXE exits while script is still running in the background
Okay so how can I get the EXE to wait without any output?