diff --git a/foam_sync.ps1 b/foam_sync.ps1 index eece326..5cb8051 100644 --- a/foam_sync.ps1 +++ b/foam_sync.ps1 @@ -49,7 +49,8 @@ try { Write-Host "Checking trigger..." $triggerMatches = $false if ($currentTrigger -is [Microsoft.Management.Infrastructure.CimInstance] ` - -and $null -ne $currentTrigger.RepetitionInterval ` + -and $currentTrigger.PSObject.Properties['RepetitionInterval'] ` + -and $currentTrigger.RepetitionInterval.PSObject.Properties['TotalMinutes'] ` -and $currentTrigger.RepetitionInterval.TotalMinutes -eq $trigger.RepetitionInterval.TotalMinutes) { $triggerMatches = $true }