From 0317031d9ab7270dcf00df2e9600ed10a0ba6bff Mon Sep 17 00:00:00 2001
From: Manuel Thalmann <m@nuth.ch>
Date: Fri, 30 Jun 2023 11:57:50 +0200
Subject: [PATCH] Fix deletion of unnecessary tasks

---
 scripts/Windows/OS/User.ps1 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/Windows/OS/User.ps1 b/scripts/Windows/OS/User.ps1
index 7ec16c63..9c066405 100644
--- a/scripts/Windows/OS/User.ps1
+++ b/scripts/Windows/OS/User.ps1
@@ -82,6 +82,8 @@ function Set-UACState([bool] $value) {
 function Enable-UACNextLogin([Context] $context) {
     Set-UACState $true;
     $tempTask = "PortValhalla Temp";
+    $autoLoginName = "PortValhalla AutoLogin Setup";
+    $uacDisablerName = "PortValhalla UAC Disabler";
     $autoLoginTrigger = Get-Random -Maximum 65535;
     $uacDisablerTrigger = Get-Random -Maximum 65535;
 
@@ -92,7 +94,7 @@ function Enable-UACNextLogin([Context] $context) {
     $optionCollection = [System.Tuple[int, string, string[]][]]@(
         [System.Tuple]::Create(
             $autoLoginTrigger,
-            "PortValhalla AutoLogin Setup",
+            $autoLoginName,
             @(
                 ". '$PSScriptRoot/../Scripts/Context.ps1';",
                 "`$context = [Context]::new();",