mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-14 22:55:52 -06:00
Remove repeated $WinUtilLaunchArguments re-assignment in Start-LatestWinUtil
This commit is contained in:
parent
af2fd17afb
commit
73aa021957
@ -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:
|
# 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.
|
# 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.
|
# 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) {
|
if ($ProcessCommand -ne $PowerShellCommand) {
|
||||||
$WinUtilLaunchArguments = "$PowerShellCommand -ExecutionPolicy Bypass -NoProfile -File `"$WinUtilScriptPath`""
|
$WinUtilLaunchArguments = "$PowerShellCommand $WinUtilLaunchArguments"
|
||||||
} else {
|
|
||||||
$WinUtilLaunchArguments = "-ExecutionPolicy Bypass -NoProfile -File `"$WinUtilScriptPath`""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# If WinUtil's launch arguments are provided, append them to the end of the list of current launch arguments.
|
# If WinUtil's launch arguments are provided, append them to the end of the list of current launch arguments.
|
||||||
|
Loading…
Reference in New Issue
Block a user