Skip to content

Instantly share code, notes, and snippets.

@jborean93
jborean93 / NoGui.ps1
Last active November 7, 2024 21:44
Generates an exe called NoGui.exe that can spawn a hidden windows
<#
NOTE: Must be run in Windows PowerShell (5.1), PowerShell (7+) cannot create standalone exes.
This is designed to create a simple exe that can be used to spawn any console
application with a hidden Window. As NoGui.exe is a GUI executable it won't
spawn with an associated console window and can be used to then create a new
process with a hidden console window with the arguments it was created with.
The arguments after -- will be used as the new process, for example
C:\path\NoGui.exe -- pwsh.exe