diff --git a/scripts/Windows/Scripts/PowerManagement.ps1 b/scripts/Windows/Scripts/PowerManagement.ps1 index d5864933..e6ed9dc3 100644 --- a/scripts/Windows/Scripts/PowerManagement.ps1 +++ b/scripts/Windows/Scripts/PowerManagement.ps1 @@ -4,6 +4,7 @@ using namespace Microsoft.Win32; $null = New-Module { [RegistryKey] $key = $null; $runOncePath = "HKLM:\Software\Microsoft\Windows\CurrentVersion\RunOnce"; + $runOnceName = "PortValhalla"; <# .SYNOPSIS @@ -27,12 +28,13 @@ $null = New-Module { $key = Get-RunOnceKey $UserKey; - Set-ItemProperty -Path $key.PSPath -Name $runOnceName -Type "ExpandString" -Value ` - "pwsh -Command " + ` - "`$env:PWSH_PATH = $(ConvertTo-Injection $env:PWSH_PATH);" + ` - "`$env:INSTALLER_SCRIPT = $(ConvertTo-Injection $env:INSTALLER_SCRIPT);" + ` - "`$env:CONFIG_MODULE = $(ConvertTo-Injection $env:CONFIG_MODULE);" + ` - "& `$env:INSTALLER_SCRIPT;"; + Set-ItemProperty -Path $key.PSPath -Name $runOnceName -Type "ExpandString" -Value ( + "pwsh -Command " + + "`$env:PWSH_PATH = $(ConvertTo-Injection $env:PWSH_PATH);" + + "`$env:INSTALLER_SCRIPT = $(ConvertTo-Injection $env:INSTALLER_SCRIPT);" + + "`$env:CONFIG_MODULE = $(ConvertTo-Injection $env:CONFIG_MODULE);" + + "& `$env:INSTALLER_SCRIPT;" + ); $key.Handle.Close(); }