Created
August 7, 2020 06:53
-
-
Save moddingg33k/9be43eb3bbc267e83933aa339ac310e0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type -Name Window -Namespace Console -MemberDefinition ' | |
[DllImport("Kernel32.dll")] | |
public static extern IntPtr GetConsoleWindow(); | |
[DllImport("user32.dll")] | |
public static extern bool ShowWindow(IntPtr hWnd, Int32 nCmdShow); | |
' | |
function Hide-ConsoleWindow | |
{ | |
$consolePtr = [Console.Window]::GetConsoleWindow() | |
[Console.Window]::ShowWindow($consolePtr, 0) | |
} | |
Hide-ConsoleWindow |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment