Ensure auto reboot is disabled properly
This commit is contained in:
parent
36a070bdd7
commit
5f6b9c05bb
|
@ -61,7 +61,10 @@ $null = New-Module {
|
||||||
Disables automatic reboots by Windows Update.
|
Disables automatic reboots by Windows Update.
|
||||||
#>
|
#>
|
||||||
function Disable-WindowsUpdateAutoRestart {
|
function Disable-WindowsUpdateAutoRestart {
|
||||||
Set-ItemProperty "$wuPolicyPath\AU" `
|
$path = "$wuPolicyPath\AU";
|
||||||
|
New-Item -Force $path -ErrorAction SilentlyContinue;
|
||||||
|
|
||||||
|
Set-ItemProperty $path `
|
||||||
-Name NoAutoRebootWithLoggedOnUsers `
|
-Name NoAutoRebootWithLoggedOnUsers `
|
||||||
-Value $Value;
|
-Value $Value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue