Unable to get endpoint Schedule to work

Hi Folks, Just started using Universal Dashboard very recently, but i am struggling to get the endpoint scheduling to function (ie refresh on any time period).

I have already out in some debug and error logging - which do not generate any output at all, suggesting the schedule itself is not being invoked?

Pretty sure is a subtle thing i have missed, I would appreciate any pointers.

Many Thanks in advance

Pete

Code is as shown below:

$Cache:ObjectsCriticalCount = $null
$Cache:ObjectsCritical = $null

$SCOMSchedule = New-UDEndpointSchedule -Every 10 -Second
$SCOMEndpoint = New-UDEndpoint -Schedule $SCOMSchedule -Endpoint {
Function-Write-Log “SCOMEndpoint Refreshing”
try {
$Cache:ObjectsCriticalCount = (Get-SCOMMonitoringObject –ComputerName $SCOMMgtServer -class:SCOMAgent | Where-Object {.HealthState -eq “Error”}).Count
$Cache:ObjectsCriticalList = Get-SCOMMonitoringObject –ComputerName $SCOMMgtServer -class:SCOMAgent | Where-Object {
.HealthState -eq “Error”} | Select DisplayName, LastModified, InmaintenanceMode | Sort-Object LastModified
}Catch {Function-Write-Error “SCOMEndpoint Refresh failed” ; $_ | Out-File $MyErrorLog}
}

<# Temporarily (read-once, duplicated from above) in place until I work out what is wrong with the schedule endpoint above. #>

$Cache:ObjectsCriticalCount = (Get-SCOMMonitoringObject –ComputerName $SCOMMgtServer -class:SCOMAgent | Where-Object {_.HealthState -eq “Error”}).Count

$Cache:ObjectsCriticalList = Get-SCOMMonitoringObject –ComputerName $SCOMMgtServer -class:SCOMAgent | Where-Object {_.HealthState -eq “Error”} | Select DisplayName, LastModified, InmaintenanceMode | Sort-Object LastModified

                                $Cache:ObjectsCriticalList  =  Import-Csv $DashboardFolderCSVs\$SCOMAgentStatuscsv | Where-Object {$_.HealthState -eq "Error"} | Select DisplayName, LastModified, InmaintenanceMode}

#New-UDGrid -AutoRefresh -RefreshInterval 10
$Page5SCOM = New-UDPage -Name “SCOM” -Icon Server -Content {
New-UDCard -Title “System Centre Operations Manager”
New-UDCounter -Title “Critical SCOM Agents Count” -AutoRefresh -RefreshInterval 10 -Endpoint {
$Cache:ObjectsCriticalCount
}
New-UdGrid -Title “Critical SCOM Agents” -AutoRefresh -RefreshInterval 10 -PageSize 20 -Headers @(“ComputerName”,“LastModified”,“Maintenance Mode”) -Properties @(“DisplayName”,“LastModified”,“InmaintenanceMode”) -Endpoint {
$Cache:ObjectsCriticalList | Select DisplayName, LastModified, InmaintenanceMode | Out-UDGridData
}
}