Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 858 Bytes

windows.md

File metadata and controls

38 lines (29 loc) · 858 Bytes
date published categories tags
2025-04-03
false
notes
untagged

Windows

Troubleshooting

Reset Windows Update (if stuck)

$ErrorActionPreference = "Stop"
$PSNativeCommandUseErrorActionPreference = $true

$wuauserv = Get-WmiObject Win32_Service | Where-Object { $_.Name -eq "wuauserv" }
if ($wuauserv -and $service.ProcessId -ne 0) {
    Write-Output "Forcibly stopping Windows Update Service $(wuauserv.ProcessId)..."
    Stop-Process -Id $service.ProcessId -Force
    Write-Output "WUAUSERV process stopped."
} else {
    Write-Output "WUAUSERV not found or not running."
}

# Alternatively, you can find the service PID via `sc queryex wuauserv`

net stop wuauserv
net stop bits

rm -rf C:\Windows\SoftwareDistribution\*

net start wuauserv
net start bits