foam_sync.ps1 (LIFEBALANCE) 2025-06-19T00:41:34Z
This commit is contained in:
@ -49,8 +49,8 @@ $taskDescription = "Periodically synchronizes the Git repository at $scriptDir u
|
|||||||
|
|
||||||
# Run as the user who executes this script.
|
# Run as the user who executes this script.
|
||||||
$taskPrincipal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -LogonType Interactive
|
$taskPrincipal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -LogonType Interactive
|
||||||
# Define a very long duration (e.g., 100 years) instead of [TimeSpan]::MaxValue
|
# Define a very long, but more conservative, duration (e.g., 10 years)
|
||||||
$practicallyIndefiniteDuration = New-TimeSpan -Days (365 * 100 + 25) # Account for leap years over 100 years
|
$practicallyIndefiniteDuration = New-TimeSpan -Days (365 * 10 + 2) # Approx 10 years, accounting for a couple of leap years
|
||||||
# Trigger configuration
|
# Trigger configuration
|
||||||
$trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Minutes $frequencyMinutes) -RepetitionDuration $practicallyIndefiniteDuration
|
$trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Minutes $frequencyMinutes) -RepetitionDuration $practicallyIndefiniteDuration
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user