Refresh large data feed once per day

Product: PowerShell Universal
Version: 3.8.7

Hi All,

I have a fairly sizeable data set that gets updated once per day. What is the most efficient way to update this data in a PowerShell Universal dashboard?

I could have a dynamic dashboard component/endpoint that updates once per 24 hours, but presumably, the user will need to leave the dashboard open for 24 hours for this to get updated? In addition, it would update once per day, per session?

Can I leverage a scheduled daily automation job to update the $cache variable that is accessible by a dashboard? If so, is there anyway to run an automation job when the PowerShell Universal service/dashboard starts?

Thanks in advance,
Iain

You can use New-UDEndpoint in your dashboard to have an interval based refresh. For example, I have one that pulls all enabled users/computers into respective $Cache variables to provide auto-complete and search capabilities in one of my dashboards. I’ve never tried with a 24hr window, but I don’t see why it wouldn’t work. Here’s the snippet from my dashboard to give you an idea:

$EndpointScheduleEvery60Mins = New-UDEndpointSchedule -Every 60 -Minute
New-UDEndpoint -Schedule $EndpointScheduleEvery60Mins -Endpoint {
    $Cache:AllEnabledUsers = Get-ADUser -Filter "Enabled -eq '$true'" | Select-Object -ExpandProperty SamAccountName | Sort-Object
    $Cache:AllEnabledDesktops = Get-ADComputer -Filter "Enabled -eq '$true'"
}

Thanks - this looks like it’ll work. Do we know whether the endpoint automagically fires when the server is started?

I’ve not tested it myself, but I think it fires at the startup of the dashboard and then at the defined interval, but you’d have to test that yourself to be sure–can restart a test dashboard a few times and see if the data updates inside the 24hr window.