From 1f85497efa349dde7b03492d0159e2e52022eb72 Mon Sep 17 00:00:00 2001 From: 0x574859 Date: Thu, 16 Feb 2023 06:04:19 +0800 Subject: [PATCH] [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 --- bin/internal/shared.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/internal/shared.bat b/bin/internal/shared.bat index 26fea94219..ae1b2296fe 100644 --- a/bin/internal/shared.bat +++ b/bin/internal/shared.bat @@ -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 )