diff --git a/foam_sync.ps1 b/foam_sync.ps1 index ae89132..76d4f41 100644 --- a/foam_sync.ps1 +++ b/foam_sync.ps1 @@ -69,7 +69,7 @@ try { } # Check Action - Write-Host "Checking action..." + Write-Verbose "Checking action..." $actionMatches = $false if ($currentAction -is [Microsoft.Management.Infrastructure.CimInstance] ` -and $currentAction.Execute -eq $taskExecute ` @@ -77,10 +77,13 @@ try { $actionMatches = $true } 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 + Write-Verbose "Checking principal..." $principalMatches = ($existingTask.Principal.UserId -eq $taskPrincipal.UserId) # Check Settings (specifically ExecutionTimeLimit for this change)