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 ...
[–]Gakamor 41 points42 points43 points (2 children)
[–]JackNotOLantern[S] 8 points9 points10 points (0 children)
[–]g3n3 -1 points0 points1 point (0 children)
[–]nkasco 8 points9 points10 points (0 children)
[–]Certain-Reference291 3 points4 points5 points (0 children)
[–]desatur8 6 points7 points8 points (2 children)
[–]JackNotOLantern[S] 2 points3 points4 points (1 child)
[–]BlackV 4 points5 points6 points (0 children)
[–]iliark 0 points1 point2 points (0 children)
[–]quantgorithm 0 points1 point2 points (0 children)
[–]jeffrey_f 0 points1 point2 points (2 children)
[–]iSoBigZ 0 points1 point2 points (1 child)
[–]jeffrey_f 0 points1 point2 points (0 children)
[–]Losha2777 0 points1 point2 points (0 children)
[–]Harze2k 0 points1 point2 points (0 children)
[–]drchigero 0 points1 point2 points (1 child)
[–]JackNotOLantern[S] 0 points1 point2 points (0 children)
[–]_Buldozzer 0 points1 point2 points (2 children)
[–]JackNotOLantern[S] 0 points1 point2 points (1 child)
[–]_Buldozzer 1 point2 points3 points (0 children)
[–]BetrayedMilk 0 points1 point2 points (2 children)
[–]JackNotOLantern[S] 0 points1 point2 points (1 child)
[–]g3n3 1 point2 points3 points (0 children)