From 6793736c3a17ce9bd5ef97551d7f7a6049f8de14 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 1 Aug 2024 02:19:05 +0200 Subject: [PATCH] Fix errors in the `PowerManagement` module --- scripts/Windows/Scripts/PowerManagement.ps1 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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(); }