Monday 26 August 2013

PowerShell console won't close after execution of a script

PowerShell console won't close after execution of a script

I have a PowerShell script that, as its last instruction, is calling a C#
program. This PowerShell script is being run on a Windows server on a
scheduler. The problem is that the PowerShell console window that the
script is using won't close or go away after the script is done executing.
We need the console window to close or else the scheduler will have
multiple PowerShell.exe programs on the task manager.
We have tried adding exit and break but the window still stays up.
Is there any way in a PowerShell script to force the console window to
close after a script is done executing?

No comments:

Post a Comment