I am new to PowerShell Universal and am planning on utilizing the cache to lookup data. I am testing this feature out and receiving an error. Any suggestions?
Set-PSUCache -Key “CurrentDate” -Value (Get-Date)
[Error] [7/9/2025 4:18:58 PM] An error occurred while sending the request.
Powershell host log:
2025-07-09 16:18:58.267 -05:00 [ERR] Job failed. An error occurred while sending the request. at System.Management.Automation.Runspaces.AsyncResult.EndInvoke()
at System.Management.Automation.PowerShell.EndInvoke(IAsyncResult asyncResult)
at UniversalAutomation.Host.JobService.d__8.MoveNext() in D:\a\universal\universal\src\Host\JobService.cs:line 232
Edit:
Just wanted to add, in PowerShell on the server itself I was able to run Set and Get-PSUCache without any issues after running Connect-PSUServer with an app token. I cannot run Get-PSUCache on a script in PSU.
Does Connect-PSUServer need to be ran on the script? If so, I am struggling to find a way to grab the app token from the secret variables without first connecting to PSUServer.
Product: PowerShell Universal
Version: 5.5.4