Cache size limit?

Product: PowerShell Universal
Version: 1.4.6

I am trying to produce a dashboard for some compliance reporting on Office 365.

Since it takes quite a while to pull all 6000 plus mailboxes real-time querying is slow.

I thought I would run a scheduled script that stores the results in a cache variable then have the dashboard use the cache displaying the age of the data the report is based upon.

It seems however there is a limit to the size of a cache variable as I get the following error.

[11:08:40] [ERR] Status(StatusCode=ResourceExhausted, Detail=“Received message larger than max (11792119 vs. 4194304)”)

Anybody any thoughts on how to get around this limit? Serialize it to a server side csv instead maybe?

So I am querying Exchange Online and pulling the default properties

You could use the $Cache scope and a scheduled endpoint directly in the dashboard. It doesn’t use the server-wide cache and doesn’t have the same size limit: Scheduled Endpoints - PowerShell Universal

Hi Adam,
I’m wondering if I use $Cache in schedule job for a Script is that variable ($Cache) system-wide so I can call it from any dashboard?

What I’m doing now is that I collect the log files from Horizon in a PSU-Cache every 2 minute and it overwrites it ofc as I only have the last 24h loggs cached but as you can understand I’m hitting the 4MB limit.

And I don’t want that in my dashboard running Scheduled Endpoints as I’m connecting to the Horizon server every 2min to collect the logdata and I don’t want every user that are using PSU to connect every time they need to look at the logs. Then I’m going to bee overflooded.

I guess that you see my issue?

The $Cache scope is only system wide if everything is using the Integrated environment. Otherwise, the $Cache is limited to the feature that it’s used within.