Stop Powershell from exiting

后端 未结 8 1899
傲寒
傲寒 2021-02-05 06:01

I know that there is that little -noexit switch for PowerShell.

Is there anyway of staying in the shell without using that switch?

In other words, I

8条回答
  •  深忆病人
    2021-02-05 06:40

    I'm not aware of a command you could run in the script that would prevent the shell from exiting if it had not been invoked using the -noexit command.

    I typically use Read-Host "Press ENTER to continue" at the end if I don't want the shell to close. However this won't prevent the shell from closing after you press enter if it had not been started with -noexit.

提交回复
热议问题