Support path with spaces

Fix #206
This commit is contained in:
LoveSy 2022-02-01 10:18:53 +08:00 committed by GitHub
parent f8b2d8868a
commit 90f601d4a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -437,7 +437,7 @@ jobs:
} }
if (-not (Test-Administrator)) { if (-not (Test-Administrator)) {
\$proc = Start-Process -PassThru -WindowStyle Hidden -Verb RunAs powershell.exe -Args "-executionpolicy bypass -command Set-Location \`"\$PSScriptRoot\`"; \`"\$PSCommandPath\`" EVAL" \$proc = Start-Process -PassThru -WindowStyle Hidden -Verb RunAs powershell.exe -Args "-executionpolicy bypass -command Set-Location '\$PSScriptRoot'; &'\$PSCommandPath' EVAL"
\$proc.WaitForExit() \$proc.WaitForExit()
if (\$proc.ExitCode -ne 0) { if (\$proc.ExitCode -ne 0) {
Clear-Host Clear-Host
@ -447,7 +447,7 @@ jobs:
exit exit
} }
elseif ((\$args.Count -eq 1) -and (\$args[0] -eq "EVAL")) { elseif ((\$args.Count -eq 1) -and (\$args[0] -eq "EVAL")) {
Start-Process powershell.exe -Args "-executionpolicy bypass -command Set-Location \`"\$PSScriptRoot\`"; \`"\$PSCommandPath\`"" Start-Process powershell.exe -Args "-executionpolicy bypass -command Set-Location '\$PSScriptRoot'; &'\$PSCommandPath'"
exit exit
} }