5.0.9 - Schedule Conditions

avatar
(anonymous user)
Product: PowerShell Universal
Version: 5.0.9


I’m working on a CRON schedule for one of my scripts that uses this (overengineered) conditional statement:

[bool](Get-PSUEventHubConnection -TrustCertificate).Where({ $null -eq $_.Disconnected }).Count


Theoretically, I shouldn’t need to explicitly cast it to a boolean nor should I need the -TrustCertificate flag, but the reason for this is that it was directly copied from tests I was running in my local terminal, which evaluated this correctly:


97dd9021678663e4eae9888d0067e9f6c973bb54

However, when I trigger the schedule, the condition presumably evaluates to false (or errors out) as the schedule never runs. Removing the condition allows the script to run as expected. Any idea what could be causing this condition to fail?

97dd9021678663e4eae9888d0067e9f6c973bb54.png

All Comments (0)