mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-02-04 06:50:09 +00:00
* 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
57 lines
2.2 KiB
PowerShell
57 lines
2.2 KiB
PowerShell
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-Host "Configuring registry settings..." -ForegroundColor Yellow
|
|
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 "Disabled BITS Service"
|
|
Set-Service -Name BITS -StartupType Disabled
|
|
|
|
Write-Host "Disabled wuauserv Service"
|
|
Set-Service -Name wuauserv -StartupType Disabled
|
|
|
|
Write-Host "Disabled UsoSvc Service"
|
|
Set-Service -Name UsoSvc -StartupType Disabled
|
|
|
|
Write-Host "Disabled WaaSMedicSvc Service"
|
|
Set-Service -Name WaaSMedicSvc -StartupType Disabled
|
|
|
|
Remove-Item "C:\Windows\SoftwareDistribution\*" -Recurse -Force
|
|
Write-Host "Cleared SoftwareDistribution folder"
|
|
|
|
Write-Host "Disabling update related scheduled tasks..." -ForegroundColor Yellow
|
|
|
|
$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 | Disable-ScheduledTask -ErrorAction SilentlyContinue
|
|
}
|
|
|
|
Write-Host "=================================" -ForegroundColor Green
|
|
Write-Host "--- Updates Are Disabled ---" -ForegroundColor Green
|
|
Write-Host "=================================" -ForegroundColor Green
|
|
|
|
Write-Host "Note: You must restart your system in order for all changes to take effect." -ForegroundColor Yellow
|
|
}
|