foam_sync.ps1 (LIFEBALANCE) 2025-06-19T19:24:08Z

This commit is contained in:
Ben Miller
2025-06-19 19:24:08 -06:00
parent 47ece60efe
commit 6c733c8049

View File

@ -69,7 +69,7 @@ try {
} }
# Check Action # Check Action
Write-Host "Checking action..." Write-Verbose "Checking action..."
$actionMatches = $false $actionMatches = $false
if ($currentAction -is [Microsoft.Management.Infrastructure.CimInstance] ` if ($currentAction -is [Microsoft.Management.Infrastructure.CimInstance] `
-and $currentAction.Execute -eq $taskExecute ` -and $currentAction.Execute -eq $taskExecute `
@ -77,10 +77,13 @@ try {
$actionMatches = $true $actionMatches = $true
} }
else { else {
Write-Warning "action does not match:`n $(Compare-Object -IncludeEqual -ReferenceObject $currentAction -DifferenceObject $action)" Write-Warning "action does not match:"
Write-Warning " Current action: $($currentAction.Execute) $($currentAction.Arguments)"
Write-Warning " Expected action: $taskExecute $taskArguments"
} }
# Check Principal # Check Principal
Write-Verbose "Checking principal..."
$principalMatches = ($existingTask.Principal.UserId -eq $taskPrincipal.UserId) $principalMatches = ($existingTask.Principal.UserId -eq $taskPrincipal.UserId)
# Check Settings (specifically ExecutionTimeLimit for this change) # Check Settings (specifically ExecutionTimeLimit for this change)