diff options
author | Liang Qi <liang.qi@qt.io> | 2019-10-01 11:25:16 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-10-03 06:12:24 +0200 |
commit | ec7bf6356ccbdaf14f5274e36f49d73013fc5a06 (patch) | |
tree | 5dfb5ecf03920307bb56d8df4ac87155d0efa3a2 /coin/provisioning/common/windows/helpers.ps1 | |
parent | 7cd2473966b08aab3117dc58025a209c68283a44 (diff) | |
parent | 29befcc995ebb3572ebe082c28e0e01f47b2baa2 (diff) |
Merge "Merge remote-tracking branch 'origin/5.13' into 5.14"
Diffstat (limited to 'coin/provisioning/common/windows/helpers.ps1')
-rw-r--r-- | coin/provisioning/common/windows/helpers.ps1 | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/coin/provisioning/common/windows/helpers.ps1 b/coin/provisioning/common/windows/helpers.ps1 index 100f14ae..8599791d 100644 --- a/coin/provisioning/common/windows/helpers.ps1 +++ b/coin/provisioning/common/windows/helpers.ps1 @@ -3,7 +3,7 @@ function Verify-Checksum Param ( [string]$File=$(throw("You must specify a filename to get the checksum of.")), [string]$Expected=$(throw("Checksum required")), - [ValidateSet("sha1","md5")][string]$Algorithm="sha1" + [ValidateSet("sha256","sha1","md5")][string]$Algorithm="sha1" ) Write-Host "Verifying checksum of $File" $fs = new-object System.IO.FileStream $File, "Open" @@ -254,3 +254,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 +} |