Fix incorrect script

This commit is contained in:
Manuel Thalmann 2023-06-29 02:54:09 +02:00
parent 2f6ee57525
commit edd97b991f

View file

@ -84,13 +84,14 @@ function Set-UACState([bool] $value) {
function Enable-UACNextLogin([Context] $context) {
Set-UACState $true;
$key = Get-SystemPolicyKey;
$action = New-ScheduledTaskAction -Execute "pwsh.exe" -Argument (
[string]::Join(
" ",
@(
"-c",
"Set-ItemProperty '$keyPath' -Name '$propertyName' -Value 0;",
"Set-ItemProperty '$($key.PSPath)' -Name 'EnableLUA' -Value 0;",
"Unregister-ScheduledTask -Force '$uacDisablerName';",
". '$PSScriptRoot/../Scripts/Context.ps1';",
"`$context = [Context]::new();",