Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. # Hide PowerShell Console
  2. Add-Type -Name Window -Namespace Console -MemberDefinition '
  3. [DllImport("Kernel32.dll")]
  4. public static extern IntPtr GetConsoleWindow();
  5. [DllImport("user32.dll")]
  6. public static extern bool ShowWindow(IntPtr hWnd, Int32 nCmdShow);
  7. '
  8. $consolePtr = [Console.Window]::GetConsoleWindow()
  9. [Console.Window]::ShowWindow($consolePtr, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement