Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

using exit & using -windowstyle "hidden"

$
0
0

Okay, I have two questions today. We will start with "exit". Exit does not work the same in powershell as it does in batch, as I'm sure you all are aware. I run my script and the prompt stays open. I want to close it. After reading some other forums I have tried:

function quit {exit}
quit

-and

function quit {exit}

set-alias quit exit

quit

-neither of these work.

---------------------------------------------------------------------------------------------------------

I'm also using:

powershell -windowstyle "Hidden"

The console opens, however, the script doesn't run properly. I can prove this because there are log files created every time the script runs, and none are created. Is this supposed to happen under certain circumstances? Is there another way to make hide the window?


Viewing all articles
Browse latest Browse all 2562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>