aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common/windows/helpers.ps1
diff options
context:
space:
mode:
authorHeikki Halmet <heikki.halmet@qt.io>2019-09-03 12:46:29 +0300
committerHeikki Halmet <heikki.halmet@qt.io>2019-09-17 11:57:11 +0300
commita3136bdbfef242339c002630f51b4bc0f5c05503 (patch)
treeb9001789becb32c31a2a2393e309de83dae078e6 /coin/provisioning/common/windows/helpers.ps1
parentb83b16277d1758c868779f931934deca7b4390b0 (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/helpers.ps1')
-rw-r--r--coin/provisioning/common/windows/helpers.ps120
1 files changed, 20 insertions, 0 deletions
diff --git a/coin/provisioning/common/windows/helpers.ps1 b/coin/provisioning/common/windows/helpers.ps1
index ba35f6b5..0f39beed 100644
--- a/coin/provisioning/common/windows/helpers.ps1
+++ b/coin/provisioning/common/windows/helpers.ps1
@@ -222,3 +222,23 @@ function Remove {
}
}
}
+
+function DisableSchedulerTask {
+
+ Param (
+ [string]$Task = $(BadParam("a task"))
+ )
+
+ Write-Host "Disabling $Task from Task Scheduler"
+ SCHTASKS /Change /TN "Microsoft\Windows\$Task" /DISABLE
+}
+
+function DeleteSchedulerTask {
+
+ Param (
+ [string]$Task = $(BadParam("a task"))
+ )
+
+ Write-Host "Disabling $Task from Task Scheduler"
+ SCHTASKS /DELETE /TN "Microsoft\Windows\$Task" /F
+}