[flutter_tools] Add the NoProfile parameter to the PowerShell execution statement (#120786)

Use the NoProfile parameter of `pwsh.exe`/`PowerShell.exe` to start PowerShell without a profile to avoid executing the scripts in the user profile
This commit is contained in:
0x574859
2023-02-16 06:04:19 +08:00
committed by GitHub
parent da2508c9f2
commit 1f85497efa

View File

@@ -118,7 +118,7 @@ GOTO :after_subroutine
REM into 1. The exit code 2 is used to detect the case where the major version is incorrect and there should be
REM no subsequent retries.
ECHO Downloading Dart SDK from Flutter engine %dart_required_version%... 1>&2
%powershell_executable% -ExecutionPolicy Bypass -Command "Unblock-File -Path '%update_dart_bin%'; & '%update_dart_bin%'; exit $LASTEXITCODE;"
%powershell_executable% -ExecutionPolicy Bypass -NoProfile -Command "Unblock-File -Path '%update_dart_bin%'; & '%update_dart_bin%'; exit $LASTEXITCODE;"
IF "%ERRORLEVEL%" EQU "2" (
EXIT 1
)