From f468804c9545939f1f8985764bc9d7ff7b3fafb0 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 21 Aug 2024 18:26:58 +0200 Subject: [PATCH] Add function for generating startup command --- scripts/Windows/Scripts/PowerManagement.ps1 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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));" +