r/PowerShell • u/JackNotOLantern • Feb 20 '26
Run powershell without terminal window
How to run ps1 script without the terminal window showing up at all?
Using -WindowStyle Hidden still shows the terminal for a moment. Minimising to tray is also not the solution i am looking for.
I saw there are external tools but they are a potential security risk.
The only way I found that works is using vbs and disabled the console window inside it. However, vbs has some other issue, and is deprecated by Microsoft currently, so i would rather find another way.
So, are there any other solutions?
Edit:
It seems that running ps1 by using conhost is the solution i needed.
conhost --headless powershell -File script.ps1 ...
View all comments
Show parent comment
2
u/_Buldozzer Feb 24 '26
You could do something very similar in C#.
Just make sure to sign it, otherwise it doesn't really has any advantage over VBS.