Skip to content

Commit

Permalink
delete scheduled task after execution
Browse files Browse the repository at this point in the history
  • Loading branch information
PfurtschellerP committed Mar 15, 2023
1 parent b3ce719 commit 915583e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions update/elevated-template.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,9 @@ $result = $t.LastTaskResult
if (Test-Path $log) {
Remove-Item $log -Force -ErrorAction SilentlyContinue | Out-Null
}

# delete scheduled task
$f.DeleteTask("\$name", 0)

[System.Runtime.Interopservices.Marshal]::ReleaseComObject($s) | Out-Null
exit $result

0 comments on commit 915583e

Please sign in to comment.