From 54d80b4bb5ed137742cf0dc0f09578b4e260c906 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 28 Jun 2023 12:35:06 +0200 Subject: [PATCH] Mute console output --- scripts/Windows/OS/User.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Windows/OS/User.ps1 b/scripts/Windows/OS/User.ps1 index f8568645..d16617c6 100644 --- a/scripts/Windows/OS/User.ps1 +++ b/scripts/Windows/OS/User.ps1 @@ -45,7 +45,7 @@ function Enable-UACNextLogin() { $taskName = "PortValhalla" $keyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"; $propertyName = "EnableLUA"; - Set-ItemProperty "$keyPath" -Name "$propertyName" -Value 1; + $null = Set-ItemProperty "$keyPath" -Name "$propertyName" -Value 1; $action = New-ScheduledTaskAction -Execute "pwsh.exe" -Argument ("-c " + ` "Set-ItemProperty `"$keyPath`" -Name `"$propertyName`" -Value 0;" + ` @@ -53,5 +53,5 @@ function Enable-UACNextLogin() { $trigger = New-ScheduledTaskTrigger -AtLogOn; $principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest; $task = New-ScheduledTask -Action $action -Principal $principal -Trigger $trigger; - Register-ScheduledTask $taskName -InputObject $task; + $null = Register-ScheduledTask $taskName -InputObject $task; }