Cached variables

I am trying to convert a dashboard such as that it can be hosted with Powershell Universal. Previously, I had an endpoint in the dashboardp.s1 file itself:

$r = New-UDEndpoint -Url “/r/” -Method “POST” -Endpoint {
$cache:r = $body

Now, I added this endpoint to Powershell Universal, where the script is just
$cache:r = $body

I need my dashboard to access this $cache:r variable to create and update a page, when a REST request is made. I must be missing something as I am able to send the request without any error but the dashboard is not updated.

In Universal, the API and dashboard run in a different process from each other so they do not share the same cache scope. That said, you’re not the first person to bring this up so we’ll have to figure out a good way to achieve this.

I’ll open a GitHub issue for this.

1 Like