We compiled a Powershell Script with the Setting "SAPIEN PowerShell V5 Host (Windows Application)" for Target "Microsoft Windows 64bit"
The Script is running good, but the Process is still running. Even if I use "Exit 0" as last Command.
Compiled Powershell-Script did not terminate
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.
-
- Posts: 3
- Last visit: Fri Mar 17, 2023 12:56 am
- Has voted: 1 time
Compiled Powershell-Script did not terminate
- Attachments
-
- CoopPrinterAdd.ps1
- Code
- (15.86 KiB) Downloaded 53 times
Exit will basically terminate the PowerShell script, but it does not destroy the Window or send a close event to it, so the window will remain there unless its a command line application.
If this was a form, you can simply close the forum object. For example, $Form1.Close() where $Form1 is the name of your form variable.
If you need to make an emergency stop, this needs to be done:
Go to full postIf this was a form, you can simply close the forum object. For example, $Form1.Close() where $Form1 is the name of your form variable.
If you need to make an emergency stop, this needs to be done:
Code: Select all
$process = Get-Process -id $pid
$null = $process.Kill()
Re: Compiled Powershell-Script did not terminate
Exit will basically terminate the PowerShell script, but it does not destroy the Window or send a close event to it, so the window will remain there unless its a command line application.
If this was a form, you can simply close the forum object. For example, $Form1.Close() where $Form1 is the name of your form variable.
If you need to make an emergency stop, this needs to be done:
If this was a form, you can simply close the forum object. For example, $Form1.Close() where $Form1 is the name of your form variable.
If you need to make an emergency stop, this needs to be done:
- $process = Get-Process -id $pid
- $null = $process.Kill()
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
-
- Posts: 3
- Last visit: Fri Mar 17, 2023 12:56 am
- Has voted: 1 time
Re: Compiled Powershell-Script did not terminate
Thank You this did the trick. I have to remove the "Exit 0" and replaced it with the code provided.
This Problem is solved.
This Problem is solved.