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"
|
$taskName = "PortValhalla"
|
||||||
$keyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System";
|
$keyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System";
|
||||||
$propertyName = "EnableLUA";
|
$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 " + `
|
$action = New-ScheduledTaskAction -Execute "pwsh.exe" -Argument ("-c " + `
|
||||||
"Set-ItemProperty `"$keyPath`" -Name `"$propertyName`" -Value 0;" + `
|
"Set-ItemProperty `"$keyPath`" -Name `"$propertyName`" -Value 0;" + `
|
||||||
|
@ -53,5 +53,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;
|
||||||
Register-ScheduledTask $taskName -InputObject $task;
|
$null = Register-ScheduledTask $taskName -InputObject $task;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue