# 恢复服务 @("wuauserv","UsoSvc","WaaSMedicSvc","bits","dosvc","CryptSvc") | ForEach-Object { Set-Service -Name $_ -StartupType Manual; Start-Service $_ -ErrorAction SilentlyContinue } # 删除注册表策略 Remove-Item "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Recurse -Force -ErrorAction SilentlyContinue # 启用计划任务 Get-ScheduledTask -TaskPath "\Microsoft\Windows\UpdateOrchestrator\*" -ErrorAction SilentlyContinue | Enable-ScheduledTask Get-ScheduledTask -TaskPath "\Microsoft\Windows\WindowsUpdate\*" -ErrorAction SilentlyContinue | Enable-ScheduledTask # 删除防火墙规则 Get-NetFirewallRule -DisplayName "Block_WindowsUpdate_*" -ErrorAction SilentlyContinue | Remove-NetFirewallRule Write-Host "? Windows Update 已恢复为默认状态" -ForegroundColor Green