Ensure auto reboot is disabled properly
This commit is contained in:
parent
d37cd11acd
commit
1fbc33cf88
|
@ -61,9 +61,12 @@ $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";
|
||||||
|
$null = New-Item -Force $path -ErrorAction SilentlyContinue;
|
||||||
|
|
||||||
|
Set-ItemProperty $path `
|
||||||
-Name NoAutoRebootWithLoggedOnUsers `
|
-Name NoAutoRebootWithLoggedOnUsers `
|
||||||
-Value $Value;
|
-Value 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
<#
|
<#
|
||||||
|
|
Loading…
Reference in a new issue