Mute console output
This commit is contained in:
parent
20d58b32d1
commit
54d80b4bb5
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue