As taken from here.
Powershell.exe -noexit C:\Scripts\Test.ps1
There are actually three parts to this command:
Powershell.exe, the Windows PowerShell executable.
-noexit, an optional parameter that tells the PowerShell console to remain open after the script finishes. Like we said, this is optional: if we leave it out the script will still run. However, the console window will close the moment the script finishes, meaning we won’t have the chance to view any data that gets displayed to the screen.
Incidentally, the -noexit parameter must immediately follow the call to the PowerShell executable. Otherwise the parameter will be ignored and the window will close anyway.C:\Scripts\Test.ps1, the path to the script file.
No comments:
Post a Comment