Fix incorrect script
This commit is contained in:
parent
2f6ee57525
commit
edd97b991f
1 changed files with 2 additions and 1 deletions
|
@ -84,13 +84,14 @@ function Set-UACState([bool] $value) {
|
||||||
|
|
||||||
function Enable-UACNextLogin([Context] $context) {
|
function Enable-UACNextLogin([Context] $context) {
|
||||||
Set-UACState $true;
|
Set-UACState $true;
|
||||||
|
$key = Get-SystemPolicyKey;
|
||||||
|
|
||||||
$action = New-ScheduledTaskAction -Execute "pwsh.exe" -Argument (
|
$action = New-ScheduledTaskAction -Execute "pwsh.exe" -Argument (
|
||||||
[string]::Join(
|
[string]::Join(
|
||||||
" ",
|
" ",
|
||||||
@(
|
@(
|
||||||
"-c",
|
"-c",
|
||||||
"Set-ItemProperty '$keyPath' -Name '$propertyName' -Value 0;",
|
"Set-ItemProperty '$($key.PSPath)' -Name 'EnableLUA' -Value 0;",
|
||||||
"Unregister-ScheduledTask -Force '$uacDisablerName';",
|
"Unregister-ScheduledTask -Force '$uacDisablerName';",
|
||||||
". '$PSScriptRoot/../Scripts/Context.ps1';",
|
". '$PSScriptRoot/../Scripts/Context.ps1';",
|
||||||
"`$context = [Context]::new();",
|
"`$context = [Context]::new();",
|
||||||
|
|
Loading…
Reference in a new issue