foam_sync.ps1 (LIFEBALANCE) 2025-06-19T00:03:26Z
This commit is contained in:
@ -53,7 +53,7 @@ $taskPrincipal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -LogonType Int
|
||||
$trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Minutes $frequencyMinutes)
|
||||
|
||||
# Action configuration: run this script
|
||||
$action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NoProfile -NonInteractive -ExecutionPolicy Bypass -File `"$scriptPath`""
|
||||
$action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NoProfile -NonInteractive -WindowStyle Hidden -ExecutionPolicy Bypass -File `"$scriptPath`""
|
||||
|
||||
# Task settings
|
||||
$settings = New-ScheduledTaskSettingsSet -ExecutionTimeLimit (New-TimeSpan -Minutes 1)
|
||||
@ -77,7 +77,7 @@ try {
|
||||
$actionMatches = $false
|
||||
if ($currentAction -is [Microsoft.Management.Infrastructure.CimInstance] `
|
||||
-and $currentAction.Execute -eq "powershell.exe" `
|
||||
-and $currentAction.Argument -eq ("-NoProfile -NonInteractive -ExecutionPolicy Bypass -File `"$scriptPath`"")) {
|
||||
-and $currentAction.Argument -eq ("-NoProfile -NonInteractive -WindowStyle Hidden -ExecutionPolicy Bypass -File `"$scriptPath`"")) {
|
||||
$actionMatches = $true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user