From 2cd6533e537f807179935b0c9a767f40c0841da9 Mon Sep 17 00:00:00 2001 From: Ben Miller Date: Thu, 19 Jun 2025 14:27:09 -0600 Subject: [PATCH] foam_sync.ps1 (LIFEBALANCE) 2025-06-19T14:27:09Z --- foam_sync.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/foam_sync.ps1 b/foam_sync.ps1 index 00f5fcb..3dbfd0d 100644 --- a/foam_sync.ps1 +++ b/foam_sync.ps1 @@ -29,7 +29,7 @@ try { # Run as the user who executes this script. $taskPrincipal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -LogonType Interactive - $trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Minutes $frequencyMinutes) + $trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval $(New-TimeSpan -Minutes $frequencyMinutes) $action = New-ScheduledTaskAction -Execute $taskExecute -Argument $taskArguments # Task settings @@ -85,7 +85,6 @@ try { catch { Write-Warning "Failed to update scheduled task '$taskName' in-place. Error: $($_.Exception.Message)" Write-Warning "The task remains in its previous state. Manual intervention may be required or re-run with Administrator privileges." - # We intentionally DO NOT unregister here to avoid the scenario you described. } } }