Powershell Tip #13: Prevent PowerShell from exiting once script finished

By | August 3, 2015

Tip: Sometimes you need to execute a Powershell script and keep the console open once the script is finished to see the result (or errors).

You can use the parameter -NoExit :

NoExit : Does not exit after running startup commands.

powershell.exe -NoExit File 'C:\scripts\Get-DiskSpace.ps1'


previous-buttonnext-button

Leave a Reply

Your email address will not be published. Required fields are marked *