Skip to content

Commit 76cefe9

Browse files
committed
Fixed Initialize.ps1
1 parent 729277e commit 76cefe9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/build-agents/Initialize.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# --- Settings ---
22
$TaskName = 'BuildAgent Daily Maintenance'
3-
$ScriptPath = "PSScriptRoot\Daily-Maintenance.ps1"
3+
$ScriptPath = "$PSScriptRoot\Daily-Maintenance.ps1"
44
$DailyAt = '03:00'
55

6+
# -- Delete the task if it exists
7+
Get-ScheduledTask -TaskName $TaskName -ErrorAction SilentlyContinue | Unregister-ScheduledTask -Confirm:$false
8+
9+
610
# --- Define action (run as SYSTEM) ---
711
$action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument "-NoProfile -ExecutionPolicy Bypass -File $ScriptPath"
812

0 commit comments

Comments
 (0)