Files
qt5/coin/pre-provisioning/qtci-windows-10-x86/disable-windows-update-medic.ps1
Heikki Halmet 704e5d5635 Update Windows 10 x86 to version 1909
These are also updated to tier1 image:
msvc 2017: 15.9.21
msvc 2017 build tools: 15.0 (26228.10)
msvc 2019: 16.4.6
msvc 2019 build tools: 16.4.6

Change-Id: I41ae0e287ccf74183438d7a7bff639fd78e86e7a
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2020-03-26 11:37:38 +02:00

26 lines
815 B
PowerShell

# Windows Update Medic Service (WaaSMedicSvc)'PerformRemediation' helps recover update-related services to the supported configuration.
# WaasMedicSvc keeps re-starting Windows Update, even if it disabled manually.
# Even Admin user don't have privileged to disable PerformRemediation from Task Scheduler which means that WaaSMedicSvc.dll need's to be removed from the system
$limit = (Get-Date).AddMinutes(20)
$path = "C:\Windows\System32\WaaSMedicSvc.dll"
DO {
takeown /F $path
icacls $path /grant Administrators:f
Write-host "Deleting $path"
Try {
del $path
}
Catch [System.UnauthorizedAccessException] {
Write-host "Access to the path '$path' is denied."
Continue
}
if ((Get-Date) -gt $limit) {
exit 1
}
}while (Test-Path -Path "$path")