Skip to content

Instantly share code, notes, and snippets.

@I-Otsuki
Last active October 29, 2019 02:03
Show Gist options
  • Save I-Otsuki/bcce6e7a738226f18cbd488b681b3577 to your computer and use it in GitHub Desktop.
Save I-Otsuki/bcce6e7a738226f18cbd488b681b3577 to your computer and use it in GitHub Desktop.
@setlocal
@pushd "%~dp0"
@set ExtractedFile=%Temp%\%~n0.ps1
@findstr /B /V @ "%~f0" > "%ExtractedFile%"
@powershell -NoLogo -NonInteractive -File "%ExtractedFile%" -ExecutionPolicy Bypass
@timeout 1 > nul 2>&1
@del "%ExtractedFile%"
@popd
@endlocal
@exit /B 0
# PowerShell code begins here.
Write-Output "Hello"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment