Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9ae366b
Update Invoke-WPFUpdatesdisable.ps1
GabiNun2 Jun 18, 2026
996eeba
Update Invoke-WPFUpdatesdisable.ps1
GabiNun2 Jun 18, 2026
c6cbc62
Update Invoke-WPFUpdatesdefault.ps1
GabiNun2 Jun 18, 2026
c6f186f
Update Invoke-WPFUpdatesdisable.ps1
GabiNun2 Jun 18, 2026
29d1dd7
Update Invoke-WPFUpdatesdefault.ps1
GabiNun2 Jun 18, 2026
89281cb
Update Invoke-WPFUpdatesdisable.ps1
GabiNun2 Jun 18, 2026
f986917
Update Invoke-WPFUpdatesdisable.ps1
GabiNun2 Jun 22, 2026
5b12945
Merge branch 'main' into fix-disable-updates
GabiNun2 Jun 22, 2026
40aaa9e
Merge branch 'ChrisTitusTech:main' into fix-disable-updates
GabiNun2 Jun 22, 2026
9c93932
Update Invoke-WPFUpdatesdisable.ps1
GabiNun2 Jun 30, 2026
0d2052d
Update Invoke-WPFUpdatesdisable.ps1
GabiNun2 Jun 30, 2026
ff54b56
Update Invoke-WPFUpdatesdefault.ps1
GabiNun2 Jun 30, 2026
1f9dd66
Update Invoke-WPFUpdatesdefault.ps1
GabiNun2 Jun 30, 2026
40fd157
Update Invoke-WPFUpdatesdisable.ps1
GabiNun2 Jun 30, 2026
ad5c035
Update Invoke-WPFUpdatesdefault.ps1
GabiNun2 Jun 30, 2026
b20a9da
Update Invoke-WPFUpdatesdefault.ps1
GabiNun2 Jun 30, 2026
39e7dea
Update Invoke-WPFUpdatesdefault.ps1
GabiNun2 Jun 30, 2026
a081d90
Update Invoke-WPFUpdatesdefault.ps1
GabiNun2 Jun 30, 2026
59bb6eb
Update Invoke-WPFUpdatesdefault.ps1
GabiNun2 Jun 30, 2026
3424fc3
Update Invoke-WPFUpdatesdefault.ps1
GabiNun2 Jun 30, 2026
0075542
Update Invoke-WPFUpdatesdisable.ps1
GabiNun2 Jun 30, 2026
52acd09
Merge branch 'main' into fix-disable-updates
GabiNun2 Jun 30, 2026
1bace96
Merge branch 'main' into fix-disable-updates
GabiNun2 Jul 2, 2026
c9c6454
Update Invoke-WPFUpdatesdefault.ps1
GabiNun2 Jul 2, 2026
36a180b
Update Invoke-WPFUpdatesdisable.ps1
GabiNun2 Jul 2, 2026
e3c4818
yep
GabiNun2 Jul 3, 2026
9337635
Update Invoke-WPFUpdatesdefault.ps1
GabiNun2 Jul 3, 2026
3031c7c
Update Invoke-WPFUpdatesdisable.ps1
GabiNun2 Jul 3, 2026
3d66189
Update Invoke-WPFUpdatesdisable.ps1
GabiNun2 Jul 3, 2026
d92d76e
Update Invoke-WPFUpdatesdefault.ps1
GabiNun2 Jul 3, 2026
85ac804
Update Invoke-WPFUpdatesdefault.ps1
GabiNun2 Jul 3, 2026
6c69860
Update Invoke-WPFUpdatesdefault.ps1
GabiNun2 Jul 3, 2026
f86fcb9
Update Invoke-WPFUpdatesdisable.ps1
GabiNun2 Jul 3, 2026
b4e6738
Merge branch 'main' into fix-disable-updates
GabiNun2 Jul 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 7 additions & 22 deletions functions/public/Invoke-WPFUpdatesdefault.ps1
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
function Invoke-WPFUpdatesdefault {
<#

.SYNOPSIS
Resets Windows Update settings to default

#>
$ErrorActionPreference = 'SilentlyContinue'
Write-WinUtilLog -Component "Updates" -Message "Resetting Windows Update settings to default."

Write-Host "Removing Windows Update policy settings..." -ForegroundColor Green
Write-WinUtilLog -Component "Updates" -Message "Removing Windows Update policy registry paths."

Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Recurse -Force
Expand All @@ -18,31 +10,26 @@ function Invoke-WPFUpdatesdefault {
Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Recurse -Force
Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Recurse -Force

Write-Host "Showing Windows Updates in settings..."
Write-WinUtilLog -Component "Updates" -Message "Showing Windows Update settings page."
Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name SettingsPageVisibility

Write-Host "Reenabling Windows Update Services..." -ForegroundColor Green
Write-WinUtilLog -Component "Updates" -Message "Restoring Windows Update service startup types."

Write-Host "Restored BITS to Manual."
Write-WinUtilLog -Component "Updates" -Message "Restoring BITS service to Manual."
Set-Service -Name BITS -StartupType Manual

Write-Host "Restored wuauserv to Manual."
Write-WinUtilLog -Component "Updates" -Message "Restoring wuauserv service to Manual."
Set-Service -Name wuauserv -StartupType Manual

Write-Host "Restored UsoSvc to Automatic."
Write-WinUtilLog -Component "Updates" -Message "Starting UsoSvc service and restoring startup type to Automatic."
Start-Service -Name UsoSvc
Write-WinUtilLog -Component "Updates" -Message "Restoring startup type to Automatic."
Set-Service -Name UsoSvc -StartupType Automatic

Write-Host "Restored WaaSMedicSvc to Manual."
Write-WinUtilLog -Component "Updates" -Message "Restoring WaaSMedicSvc service to Manual."
Set-Service -Name WaaSMedicSvc -StartupType Manual

Write-Host "Enabling update related scheduled tasks..." -ForegroundColor Green
Write-WinUtilLog -Component "Updates" -Message "Enabling update related dll files."
Rename-Item -Path $Env:SystemRoot\System32\usosvc.dlle -NewName usosvc.dll

Write-WinUtilLog -Component "Updates" -Message "Enabling update related scheduled tasks."

$Tasks =
Expand All @@ -57,14 +44,12 @@ function Invoke-WPFUpdatesdefault {
Get-ScheduledTask -TaskPath $Task | Enable-ScheduledTask -ErrorAction SilentlyContinue
}

Write-Host "Windows Local Policies Reset to Default."
Write-WinUtilLog -Component "Updates" -Message "Resetting local security policy to defaults with secedit."
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-WinUtilLog -Component "Updates" -Message "==================================================="
Write-WinUtilLog -Component "Updates" -Message "--- Windows Update Settings Reset to Default ---"
Write-WinUtilLog -Component "Updates" -Message "==================================================="

Write-Host "Note: You must restart your system in order for all changes to take effect." -ForegroundColor Yellow
Write-WinUtilLog -Component "Updates" -Message "Windows Update default workflow completed. Restart required."
}
64 changes: 10 additions & 54 deletions functions/public/Invoke-WPFUpdatesdisable.ps1
Original file line number Diff line number Diff line change
@@ -1,66 +1,22 @@
function Invoke-WPFUpdatesdisable {
<#

.SYNOPSIS
Disables Windows Update

.NOTES
Disabling Windows Update is not recommended. This is only for advanced users who know what they are doing.

#>
$ErrorActionPreference = 'SilentlyContinue'
Write-WinUtilLog -Component "Updates" -Message "Disabling Windows Update settings."

Write-Host "Configuring registry settings..." -ForegroundColor Yellow
Write-WinUtilLog -Component "Updates" -Message "Configuring Windows Update registry policy values for disable mode."
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force

Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoUpdate" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUOptions" -Type DWord -Value 1

New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Force
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 0

Write-Host "Hiding Windows Updates from settings..."
Write-WinUtilLog -Component "Updates" -Message "Hiding Windows Update settings page."
Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name SettingsPageVisibility -Value hide:windowsupdate

Write-Host "Disabled BITS Service."
Write-WinUtilLog -Component "Updates" -Message "Disabling BITS service."
Set-Service -Name BITS -StartupType Disabled

Write-Host "Disabled wuauserv Service."
Write-WinUtilLog -Component "Updates" -Message "Disabling wuauserv service."
Set-Service -Name wuauserv -StartupType Disabled

Write-Host "Disabled UsoSvc Service."
Write-WinUtilLog -Component "Updates" -Message "Stopping and disabling UsoSvc service."
Stop-Service -Name UsoSvc -Force
Write-WinUtilLog -Component "Updates" -Message "Disabling UsoSvc service."
Set-Service -Name UsoSvc -StartupType Disabled

Remove-Item "C:\Windows\SoftwareDistribution\*" -Recurse -Force
Write-Host "Cleared SoftwareDistribution folder."
Write-WinUtilLog -Component "Updates" -Message "Cleared SoftwareDistribution folder."

Write-Host "Disabling update related scheduled tasks..." -ForegroundColor Yellow
Write-WinUtilLog -Component "Updates" -Message "Disabling update related scheduled tasks."
Write-WinUtilLog -Component "Updates" -Message "Disabling update related dll files."

$Tasks =
'\Microsoft\Windows\InstallService\*',
'\Microsoft\Windows\UpdateOrchestrator\*',
'\Microsoft\Windows\UpdateAssistant\*',
'\Microsoft\Windows\WaaSMedic\*',
'\Microsoft\Windows\WindowsUpdate\*',
'\Microsoft\WindowsUpdate\*'
takeown /f $Env:SystemRoot\System32\usosvc.dll
icacls $Env:SystemRoot\System32\usosvc.dll /grant Everyone:F
Rename-Item -Path $Env:SystemRoot\System32\usosvc.dll -NewName usosvc.dlle

foreach ($Task in $Tasks) {
Get-ScheduledTask -TaskPath $Task | Disable-ScheduledTask -ErrorAction SilentlyContinue
}
Write-WinUtilLog -Component "Updates" -Message "Clearing SoftwareDistribution folder."
Remove-Item "C:\Windows\SoftwareDistribution\*" -Recurse -Force -ErrorAction SilentlyContinue

Write-Host "=================================" -ForegroundColor Green
Write-Host "--- Updates Are Disabled ---" -ForegroundColor Green
Write-Host "=================================" -ForegroundColor Green
Write-WinUtilLog -Component "Updates" -Message "================================="
Write-WinUtilLog -Component "Updates" -Message "--- Updates Are Disabled ---"
Write-WinUtilLog -Component "Updates" -Message "================================="

Write-Host "Note: You must restart your system in order for all changes to take effect." -ForegroundColor Yellow
Write-WinUtilLog -Component "Updates" -Message "Windows Update disable workflow completed. Restart required."
}