Install updates only as admin

This commit is contained in:
Manuel Thalmann 2024-08-09 16:02:24 +02:00
parent 7a99482bc8
commit b034dfd53d

View file

@ -124,15 +124,17 @@ $null = New-Module {
break; break;
} }
default { default {
$null = Import-Module PSWindowsUpdate; if (Test-Admin) {
$null = Import-Module PSWindowsUpdate;
Invoke-Hook "Invoke-WindowsUpdate" -Fallback { Invoke-Hook "Invoke-WindowsUpdate" -Fallback {
Update-WindowsInstallation; Update-WindowsInstallation;
}; };
if ((Get-WURebootStatus -Silent)) { if ((Get-WURebootStatus -Silent)) {
Restart-Intermediate; Restart-Intermediate;
return; return;
}
} }
<# <#