Ensure auto reboot is disabled properly

This commit is contained in:
Manuel Thalmann 2024-08-12 21:32:53 +02:00
parent 5096e966a8
commit 48ab2ba2a1

View file

@ -61,9 +61,12 @@ $null = New-Module {
Disables automatic reboots by Windows Update.
#>
function Disable-WindowsUpdateAutoRestart {
Set-ItemProperty "$wuPolicyPath\AU" `
$path = "$wuPolicyPath\AU";
$null = New-Item -Force $path -ErrorAction SilentlyContinue;
Set-ItemProperty $path `
-Name NoAutoRebootWithLoggedOnUsers `
-Value $Value;
-Value 1;
}
<#