aboutsummaryrefslogtreecommitdiffstats
path: root/coin/pre-provisioning/qtci-windows-10_22H2-x86_64/disable-windows-update-medic.ps1
diff options
context:
space:
mode:
authorHeikki Halmet <heikki.halmet@qt.io>2022-11-04 14:12:18 +0000
committerHeikki Halmet <heikki.halmet@qt.io>2022-11-18 08:34:53 +0000
commite9b3497c8e8c6f50947f23a9a22bdc69d3674239 (patch)
tree41d2a6656958edb70be9c41599a0414514475362 /coin/pre-provisioning/qtci-windows-10_22H2-x86_64/disable-windows-update-medic.ps1
parent3d05c6774930d882c173c79c677687fabe33b973 (diff)
Add Windows 10 22H2 to CI
Pre-installed to tier 1: MSVC 2022 17.3.6 plus build tools MSVC 2019 16.11.20 plus build tools MSVC 2015 update 3 14.0.25420.1 Task-number: QTQAINFRA-5262 Change-Id: Ibcc2950dd7edef0d6aa92cef7e602a69da8498d9 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Diffstat (limited to 'coin/pre-provisioning/qtci-windows-10_22H2-x86_64/disable-windows-update-medic.ps1')
-rw-r--r--coin/pre-provisioning/qtci-windows-10_22H2-x86_64/disable-windows-update-medic.ps125
1 files changed, 25 insertions, 0 deletions
diff --git a/coin/pre-provisioning/qtci-windows-10_22H2-x86_64/disable-windows-update-medic.ps1 b/coin/pre-provisioning/qtci-windows-10_22H2-x86_64/disable-windows-update-medic.ps1
new file mode 100644
index 00000000..e8210ea3
--- /dev/null
+++ b/coin/pre-provisioning/qtci-windows-10_22H2-x86_64/disable-windows-update-medic.ps1
@@ -0,0 +1,25 @@
+# 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\WaaSMedicAgent.exe"
+
+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")