From 73aa02195788a5ef736fb83f43b8a21ed38ebb89 Mon Sep 17 00:00:00 2001 From: Cryostrixx Date: Mon, 23 Sep 2024 11:15:37 -0700 Subject: [PATCH] Remove repeated $WinUtilLaunchArguments re-assignment in Start-LatestWinUtil --- windev.ps1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/windev.ps1 b/windev.ps1 index 34cf932a..f48b70c4 100644 --- a/windev.ps1 +++ b/windev.ps1 @@ -121,10 +121,9 @@ function Start-LatestWinUtil { # Setup the script's launch arguments based on the presence of Windows Terminal or Windows PowerShell/PowerShell Core: # 1. Windows Terminal needs the name of the process to start ($PowerShellCommand) in addition to the launch arguments. # 2. Windows PowerShell and PowerShell Core can receive and use the launch arguments as is without extra modification. + $WinUtilLaunchArguments = "-ExecutionPolicy Bypass -NoProfile -File `"$WinUtilScriptPath`"" if ($ProcessCommand -ne $PowerShellCommand) { - $WinUtilLaunchArguments = "$PowerShellCommand -ExecutionPolicy Bypass -NoProfile -File `"$WinUtilScriptPath`"" - } else { - $WinUtilLaunchArguments = "-ExecutionPolicy Bypass -NoProfile -File `"$WinUtilScriptPath`"" + $WinUtilLaunchArguments = "$PowerShellCommand $WinUtilLaunchArguments" } # If WinUtil's launch arguments are provided, append them to the end of the list of current launch arguments.