From 331261ac736f2696017c19f4e6d652ff2f3230c6 Mon Sep 17 00:00:00 2001 From: Ben Miller Date: Thu, 19 Jun 2025 18:57:22 -0600 Subject: [PATCH] foam_sync.ps1 (LIFEBALANCE) 2025-06-19T18:57:22Z --- foam_sync.ps1 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/foam_sync.ps1 b/foam_sync.ps1 index bef22ca..9eee7ca 100644 --- a/foam_sync.ps1 +++ b/foam_sync.ps1 @@ -1,4 +1,8 @@ #Requires -Version 5.1 + +[CmdletBinding()] +param () + Set-StrictMode -Version 3.0 $scriptPath = $MyInvocation.MyCommand.Path @@ -32,9 +36,20 @@ try { $repetitionInterval = New-TimeSpan -Minutes $frequencyMinutes $trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval $repetitionInterval $action = New-ScheduledTaskAction -Execute $taskExecute -Argument $taskArguments + $settings = New-ScheduledTaskSettingsSet -ExecutionTimeLimit $(New-TimeSpan -Seconds $timeLimitSeconds) + Write-Verbose "Task name: $taskName" + Write-Verbose "Description: $taskDescription" + Write-Verbose "Execute: $taskExecute" + Write-Verbose "Arguments: $taskArguments" + Write-Verbose "Frequency: $frequencyMinutes minutes" + Write-Verbose "Time limit: $timeLimitSeconds seconds" + Write-Verbose "Trigger: $trigger" + Write-Verbose "Action: $action" + Write-Verbose "Principal: $taskPrincipal" + Write-Verbose "Settings: $settings" + # Task settings - $settings = New-ScheduledTaskSettingsSet -ExecutionTimeLimit $(New-TimeSpan -Seconds $timeLimitSeconds) # Check and configure the scheduled task try {