Files
LogSeq/pages/Scripts/Powershell - create tasks for FFS.sync-conflict-20250817-085608-UULL5XD.md
2025-12-11 06:26:12 -08:00

28 lines
719 B
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: Powershell - create tasks for FFS
updated: 2021-03-08 21:09:39Z
created: 2021-03-08 21:09:23Z
---
```powershell
Get-ChildItem -Path c:\\Users\\sstent\\Documents\\*.ffs_batch | foreach {
echo $_.FullName
$DelayTimeSpan = New-TimeSpan -Hours 2
$A = New-ScheduledTaskAction -Execute \"C:\\Program Files\\FreeFileSync\\FreeFileSync.exe\" -Argument $_.FullName
$T = New-ScheduledTaskTrigger -Daily -At 7am -RandomDelay $DelayTimeSpan
$P = New-ScheduledTaskPrincipal \"sstent\" -RunLevel Limited -LogonType Interactive
$S = New-ScheduledTaskSettingsSet 
$D = New-ScheduledTask -Action $A -Principal $P -Trigger $T -Settings $S
Register-ScheduledTask $_.Name -InputObject $D -TaskPath \"\\sync\\\"
}
```