Files
LogSeqDB/pages/Scripts/Powershell - create tasks for FFS.md
2025-12-11 06:26:12 -08:00

27 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:39+00:00
created:: 2021-03-08 21:09:23+00:00
```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\\"
}
```