Skip to content

Instantly share code, notes, and snippets.

@darthwalsh
Created October 6, 2016 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darthwalsh/cdbd331ed9cea80fa5cc632c71512caa to your computer and use it in GitHub Desktop.
Save darthwalsh/cdbd331ed9cea80fa5cc632c71512caa to your computer and use it in GitHub Desktop.
WPowerShell
CreateObject("WScript.Shell").Run "powershell.exe -nologo -file """ & WScript.Arguments.Item(0) & """" ,0
@darthwalsh
Copy link
Author

Want to run a powershell script without opening a new console window? Save wpowershell.vbs to your PATH, then invoke like this:

wpowershell C:\blah.ps1

@darthwalsh
Copy link
Author

Alternatively, use Vittel/RunHiddenConsole to compile powershellw.exe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment