Change name of UAC disabler

This commit is contained in:
Manuel Thalmann 2023-06-28 22:08:20 +02:00
parent 94a5f09aa4
commit 1aabdc228e

View file

@ -1,4 +1,5 @@
. "$PSScriptRoot/../Scripts/Context.ps1"; . "$PSScriptRoot/../Scripts/Context.ps1";
$uacDisablerName = "PortValhalla UAC Disabler";
function New-PersonalUser([Context] $context) function New-PersonalUser([Context] $context)
{ {
@ -42,7 +43,6 @@ function New-PersonalUser([Context] $context)
} }
function Enable-UACNextLogin() { function Enable-UACNextLogin() {
$taskName = "PortValhalla";
$keyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"; $keyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System";
$propertyName = "EnableLUA"; $propertyName = "EnableLUA";
$null = Set-ItemProperty "$keyPath" -Name "$propertyName" -Value 1; $null = Set-ItemProperty "$keyPath" -Name "$propertyName" -Value 1;
@ -57,5 +57,5 @@ function Enable-UACNextLogin() {
$trigger = New-ScheduledTaskTrigger -AtLogOn; $trigger = New-ScheduledTaskTrigger -AtLogOn;
$principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest; $principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest;
$task = New-ScheduledTask -Action $action -Principal $principal -Trigger $trigger; $task = New-ScheduledTask -Action $action -Principal $principal -Trigger $trigger;
$null = Register-ScheduledTask $taskName -InputObject $task; $null = Register-ScheduledTask $uacDisablerName -InputObject $task;
} }