# Crée la tâche planifiée (toutes les heures)
$action  = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NonInteractive -File C:\dev\crowdlending-app\.cowork\sync-cowork-memory.ps1"
$trigger = New-ScheduledTaskTrigger -RepetitionInterval (New-TimeSpan -Hours 1) -Once -At (Get-Date)
$settings = New-ScheduledTaskSettingsSet -ExecutionTimeLimit (New-TimeSpan -Minutes 5)

Register-ScheduledTask -TaskName "CoworkMemorySync-crowdlending" -Action $action -Trigger $trigger -Settings $settings -RunLevel Highest -Force