diff --git a/scripts/Windows/Scripts/PowerManagement.ps1 b/scripts/Windows/Scripts/PowerManagement.ps1 index 498d9bbc..20faed40 100644 --- a/scripts/Windows/Scripts/PowerManagement.ps1 +++ b/scripts/Windows/Scripts/PowerManagement.ps1 @@ -43,15 +43,14 @@ $null = New-Module { Generates a script for executing the installer. #> function Get-StartupScript { - "pwsh " + (Get-StartupArguments); + "pwsh -Command " + (Get-StartupCommand); } <# .SYNOPSIS - Generates arguments for running the installer using `pwsh`. + Generates a command for running the installer using `pwsh`. #> - function Get-StartupArguments { - "-Command " + + function Get-StartupCommand { ($env:PWSH_PATH ? "`$env:PWSH_PATH = $(ConvertTo-Injection $env:PWSH_PATH);" : "") + ($env:DEBUG ? "`$env:DEBUG = $([int]$env:DEBUG);" : "") + "`$env:INSTALLER_SCRIPT = $(ConvertTo-Injection (Resolve-Path $env:INSTALLER_SCRIPT));" +