Files
winutil/functions/public/Invoke-WPFUpdatesdefault.ps1
Gabi 79ee9db8fe Update-Updates-Tab (#3833)
* Update Invoke-WPFUpdatessecurity.ps1

* Update Invoke-WPFUpdatesdisable.ps1

* Update Invoke-WPFUpdatesdefault.ps1

* Update Invoke-WPFUpdatesdefault.ps1

* Update Invoke-WPFUpdatesdisable.ps1

* Update Invoke-WPFUpdatesdisable.ps1

* Update Invoke-WPFUpdatessecurity.ps1

* Update Invoke-WPFUpdatessecurity.ps1

* Update Invoke-WPFUpdatesdefault.ps1

* Update Invoke-WPFUpdatesdisable.ps1

* Update Invoke-WPFUpdatessecurity.ps1

* Update Invoke-WPFUpdatesdisable.ps1

* Update Invoke-WPFUpdatesdisable.ps1

* Update Invoke-WPFUpdatesdisable.ps1

* Update Invoke-WPFUpdatesdefault.ps1

* Update Invoke-WPFUpdatesdisable.ps1

* Update Invoke-WPFUpdatesdefault.ps1

* Update Invoke-WPFUpdatesdisable.ps1

* Update Invoke-WPFUpdatesdefault.ps1

* Update Invoke-WPFUpdatesdisable.ps1

* Update Invoke-WPFUpdatesdefault.ps1

* Update Invoke-WPFUpdatesdisable.ps1

* Update Invoke-WPFUpdatesdisable.ps1

* Update Invoke-WPFUpdatesdefault.ps1

* Update Invoke-WPFUpdatesdefault.ps1

* Update Invoke-WPFUpdatessecurity.ps1

* Update Invoke-WPFUpdatessecurity.ps1

* Update Invoke-WPFUpdatesdisable.ps1

* Update Invoke-WPFUpdatesdefault.ps1

* Update Invoke-WPFUpdatesdefault.ps1

* Update Invoke-WPFUpdatesdefault.ps1
2026-01-08 13:04:36 -06:00

56 lines
2.3 KiB
PowerShell

function Invoke-WPFUpdatesdefault {
<#
.SYNOPSIS
Resets Windows Update settings to default
#>
$ErrorActionPreference = 'SilentlyContinue'
Write-Host "Removing Windows Update policy settings..." -ForegroundColor Green
Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Recurse -Force
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization" -Recurse -Force
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Recurse -Force
Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Recurse -Force
Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Recurse -Force
Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Recurse -Force
Write-Host "Reenabling Windows Update Services..." -ForegroundColor Green
Write-Host "Restored BITS to Manual"
Set-Service -Name BITS -StartupType Manual
Write-Host "Restored wuauserv to Manual"
Set-Service -Name wuauserv -StartupType Manual
Write-Host "Restored UsoSvc to Automatic"
Set-Service -Name UsoSvc -StartupType Automatic
Write-Host "Restored WaaSMedicSvc to Manual"
Set-Service -Name WaaSMedicSvc -StartupType Manual
Write-Host "Enabling update related scheduled tasks..." -ForegroundColor Green
$Tasks =
'\Microsoft\Windows\InstallService\*',
'\Microsoft\Windows\UpdateOrchestrator\*',
'\Microsoft\Windows\UpdateAssistant\*',
'\Microsoft\Windows\WaaSMedic\*',
'\Microsoft\Windows\WindowsUpdate\*',
'\Microsoft\WindowsUpdate\*'
foreach ($Task in $Tasks) {
Get-ScheduledTask -TaskPath $Task | Enable-ScheduledTask -ErrorAction SilentlyContinue
}
Write-Host "Windows Local Policies Reset to Default"
secedit /configure /cfg "$Env:SystemRoot\inf\defltbase.inf" /db defltbase.sdb
Write-Host "===================================================" -ForegroundColor Green
Write-Host "--- Windows Update Settings Reset to Default ---" -ForegroundColor Green
Write-Host "===================================================" -ForegroundColor Green
Write-Host "Note: You must restart your system in order for all changes to take effect." -ForegroundColor Yellow
}