Get-PSUCache and Wildcards

Product: PowerShell Universal
Version: 5.6.13

I noticed that 5.6.7 included the addition of support for using wildcards with the Get-PSUCache cmdlet, but I can’t seem to get it to work.

The issue where it was added is here and seems to imply that I would just need to use an asterisk character in the value of the -Key parameter, but I’m not having any success. The API docs for Get-PSUCache seems to imply that ‘Accept wildcard characters’ is false? Has anyone implemented this?

Improve Efficiency of Cache Cmdlets · Issue #5095 · ironmansoftware/powershell-universal

I use PSU Cache in my app, but I haven’t explored the Get-PSUCache cmdlet until now.

I immediately thought I could connect to the server and use it, but nothing worked.

Then, when I ran it through Get-Help, it says: “This cmdlet can only be called within APIs, dashboards and scripts. You cannot access the server-wide cache through the PowerShell Universal Management API.”

So to clarify, are you trying to run the command directly on the server? Or from within an app? If so, I’m curious about the use case since all my cache usage thus far is presently sucking data into $Cache:SomeVariable and haven’t needed to Get-PSUCache yet.

TY! –Matt

Are you using the Cache: scope or the Server-Level cache?

I’m calling Get-PSUCache in a few different functions in a module that both a dashboard and an API endpoint use.