Skip to content

Instantly share code, notes, and snippets.

@DanielSmon
Created March 10, 2021 07:00
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 DanielSmon/60bfc5f36facaa7ab6377b4589fdec2d to your computer and use it in GitHub Desktop.
Save DanielSmon/60bfc5f36facaa7ab6377b4589fdec2d to your computer and use it in GitHub Desktop.
PowerShell launch cmd
@ECHO OFF
REM Rename this file to be the same name as your PowerShell .ps1 script.
REM This script must be in the same directory as your .ps1 script.
PowerShell.exe -NoProfile -Command "& {Start-Process PowerShell.exe -ArgumentList '-NoProfile -ExecutionPolicy Bypass -Command ""& {%~dpn0.ps1;pause}""' -Verb RunAs}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment