Last active
December 25, 2017 04:24
-
-
Save turboBasic/f37b7dfe413485bea1ad2252236231cd to your computer and use it in GitHub Desktop.
[Pass-ArgumentsToPowershell.cmd] Calling #Powershell from Cmd.exe with complex arguments with quotes and spaces
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
| @echo off | |
| setlocal enabledelayedexpansion | |
| set args=%* | |
| set args=%args:"='% | |
| set args=%args:(=`(% | |
| set args=%args:)=`)% | |
| set invalid="=' | |
| if !args! == !invalid! ( set args= ) | |
| powershell.exe -noLogo -noProfile -executionPolicy Unrestricted -command "Invoke-Shimgen -path %args%; exit $lastExitCode" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment