Add function for generating startup command

This commit is contained in:
Manuel Thalmann 2024-08-21 18:26:58 +02:00
parent 682571eeba
commit f468804c95

View file

@ -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));" +