foam_sync.ps1 (LIFEBALANCE) 2025-06-19T13:46:06Z

This commit is contained in:
Ben Miller
2025-06-19 13:46:06 -06:00
parent d5ca7cf365
commit 7e46c2704e

View File

@ -2,7 +2,6 @@
# --- Configuration ---
$frequencyMinutes = 2 # How often the Scheduled Task should attempt to run this script
$executionTimeLimitBufferSeconds = 30 # Buffer: task stops if it runs longer than (frequency - buffer)
# --- Scheduled Task Setup ---
$taskName = "FoamGitSync"
@ -80,7 +79,9 @@ try {
Write-Host "Scheduled task '$taskName' is already correctly configured."
}
else {
Write-Host "Scheduled task '$taskName' configuration differs. Attempting to update in-place..."
Write-Host "Scheduled task '$taskName' configuration differs."
Write-Host "`$triggerMatches: $triggerMatches, $actionMatches: $actionMatches, $principalMatches: $principalMatches, $settingsMatch: $settingsMatch`"
Write-Host "Attempting to update in-place..."
try {
Set-ScheduledTask -TaskName $taskName -Action $action -Trigger $trigger -Settings $settings -Principal $taskPrincipal -ErrorAction Stop
Write-Host "Scheduled task '$taskName' updated successfully."