mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-23 11:07:10 +01:00
[vcpkgInvokeCommandClean] Don't use -encodedCommand.
Instead, use -Command with the appropriate number of escaped quotes (which ended up being 3)
This commit is contained in:
parent
815e3caf55
commit
3aac3957ae
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user