diff --git a/foam_sync.ps1 b/foam_sync.ps1 index 3dbfd0d..1fa719a 100644 --- a/foam_sync.ps1 +++ b/foam_sync.ps1 @@ -29,7 +29,8 @@ 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) + $repetitionInterval = New-TimeSpan -Minutes $frequencyMinutes + $trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval $repetitionInterval $action = New-ScheduledTaskAction -Execute $taskExecute -Argument $taskArguments # Task settings