diff options
author | Heikki Halmet <heikki.halmet@qt.io> | 2019-09-03 12:46:29 +0300 |
---|---|---|
committer | Heikki Halmet <heikki.halmet@qt.io> | 2019-09-17 11:57:11 +0300 |
commit | a3136bdbfef242339c002630f51b4bc0f5c05503 (patch) | |
tree | b9001789becb32c31a2a2393e309de83dae078e6 /coin/provisioning/common/windows/disable-windows-update-medic.ps1 | |
parent | b83b16277d1758c868779f931934deca7b4390b0 (diff) |
Provisioning: Disable or delete unneeded tasks and services
Windows have lot's of tasks and services running which are slowing
the performance of build machine. Also 'windows' and 'windows
defender' updates need's to be "permanently" disabled.
Task-number: QTQAINFRA-3182
Change-Id: I8f6b237fcdc6e38fa9a06836d349821d86c58afc
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Diffstat (limited to 'coin/provisioning/common/windows/disable-windows-update-medic.ps1')
-rw-r--r-- | coin/provisioning/common/windows/disable-windows-update-medic.ps1 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/coin/provisioning/common/windows/disable-windows-update-medic.ps1 b/coin/provisioning/common/windows/disable-windows-update-medic.ps1 new file mode 100644 index 00000000..6accbd3b --- /dev/null +++ b/coin/provisioning/common/windows/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\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") |