Set-ExecutionPolicy

This commit is contained in:
LoveSy 2022-04-14 13:42:15 +08:00 committed by GitHub
parent 74e041bc0f
commit 63609f1b32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -531,6 +531,7 @@ jobs:
} }
if (-not (Test-Administrator)) { if (-not (Test-Administrator)) {
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass -Force
\$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) {