Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install-WindowsUpdate does not refresh update status in GUI #46

Open
timbck2 opened this issue Jan 17, 2025 · 1 comment
Open

Install-WindowsUpdate does not refresh update status in GUI #46

timbck2 opened this issue Jan 17, 2025 · 1 comment

Comments

@timbck2
Copy link

timbck2 commented Jan 17, 2025

Environment:
PSWindowsUpdate v2.2.1.5
Windows Server 2022 w/Windows Powershell that comes with the OS
Internal WSUS server managed using the Windows Server Update Services management console

Based on the suggestions from this URL: https://serverfault.com/questions/395417/microsoft-windows-install-updates-and-restart-instead-of-install-and-shutdown/825111#825111, I installed PSWindowsUpdate, then used this sequence of commands to check WSUS for available updates, then install them and reboot the server:

Get-WUInstall
Install-WindowsUpdate -AcceptAll -AutoReboot

After the server came back up, I opened the Windows Update panel in the Settings app, and the updates (there were three of them) were still showing as "Pending Install", even though I had watched them get installed before the reboot. So I clicked the button to install all updates, and they immediately went from "Pending Install" status to installed, which I verified by looking at the Update History.

So apparently the Install-WindowsUpdate command is not refreshing the update status when it finishes.

@vecerap
Copy link

vecerap commented Feb 2, 2025

This is because Windows Update cache is stuck. What I suspect is WU does not expect other application would perform update without GUI intervention. If you run script for cleanup, the GUI will be after reboot normal:

 # Stop the necessary services
    Stop-Service -Name "wuauserv" -Force
    Stop-Service -Name "cryptSvc" -Force
    Stop-Service -Name "bits" -Force
    Stop-Service -Name "msiserver" -Force

    Write-Host "Deleting SoftwareDistribution..."
    rm -r -fo "C:\Windows\SoftwareDistribution"
    Write-Host "Deleted SoftwareDistribution"

    Write-Host "Deleting catroot..."
    rm -r -fo "C:\Windows\System32\catroot2"
    Write-Host "Deleted catroot"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants