aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2018-02-07 17:31:19 -0800
committerAlexander Karatarakis <alkarata@microsoft.com>2018-02-07 17:31:30 -0800
commit3aac3957ae9053eb3ffb97bcc49148e7b0a4c050 (patch)
tree640b1de67c2623a922f4837fb217c9ab84bc4c02 /scripts
parent815e3caf5573d1149e1f826b359beb9039293307 (diff)
downloadvcpkg-3aac3957ae9053eb3ffb97bcc49148e7b0a4c050.tar.gz
vcpkg-3aac3957ae9053eb3ffb97bcc49148e7b0a4c050.zip
[vcpkgInvokeCommandClean] Don't use -encodedCommand.
Instead, use -Command with the appropriate number of escaped quotes (which ended up being 3)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/VcpkgPowershellUtils.ps18
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1
index 4334df2cc..bed78b198 100644
--- a/scripts/VcpkgPowershellUtils.ps1
+++ b/scripts/VcpkgPowershellUtils.ps1
@@ -190,10 +190,10 @@ function vcpkgInvokeCommandClean()
Write-Verbose "Clean-Executing: ${executable} ${arguments}"
$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition
$cleanEnvScript = "$scriptsDir\VcpkgPowershellUtils-ClearEnvironment.ps1"
- $command = "& `"$cleanEnvScript`"; & `"$executable`" $arguments"
- $bytes = [System.Text.Encoding]::Unicode.GetBytes($command)
- $encodedCommand = [Convert]::ToBase64String($bytes)
- $arg = "-NoProfile -ExecutionPolicy Bypass -encodedCommand $encodedCommand"
+ $tripleQuotes = "`"`"`""
+ $argumentsWithEscapedQuotes = $arguments -replace "`"", $tripleQuotes
+ $command = ". $tripleQuotes$cleanEnvScript$tripleQuotes; & $tripleQuotes$executable$tripleQuotes $argumentsWithEscapedQuotes"
+ $arg = "-NoProfile", "-ExecutionPolicy Bypass", "-command $command"
$process = Start-Process -FilePath powershell.exe -ArgumentList $arg -PassThru -NoNewWindow
Wait-Process -InputObject $process