Install updates only as admin

This commit is contained in:
Manuel Thalmann 2024-08-09 16:02:24 +02:00
parent 767b7ad228
commit db37209a14

View file

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