diff --git a/scripts/Windows/Scripts/PowerManagement.ps1 b/scripts/Windows/Scripts/PowerManagement.ps1 index 2741bcf9..774eaa98 100644 --- a/scripts/Windows/Scripts/PowerManagement.ps1 +++ b/scripts/Windows/Scripts/PowerManagement.ps1 @@ -30,7 +30,13 @@ $null = New-Module { Set-ItemProperty -Path $key.PSPath -Name $runOnceName -Type "ExpandString" -Value ( "pwsh -Command " + - "`$env:PWSH_PATH = $(ConvertTo-Injection $env:PWSH_PATH);" + + (& { + if ($env:PWSH_PATH) { + "`$env:PWSH_PATH = $(ConvertTo-Injection $env:PWSH_PATH);" + } else { + "" + } + }) + "`$env:INSTALLER_SCRIPT = $(ConvertTo-Injection $env:INSTALLER_SCRIPT);" + "`$env:CONFIG_MODULE = $(ConvertTo-Injection $env:CONFIG_MODULE);" + "& `$env:INSTALLER_SCRIPT;"