Remove redundant entries from the Cache Editor

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
datacore.glenn
Posts: 30
Meble kuchenne na zamówienie - na wymiar - Wrocław
Joined: Mon Apr 09, 2012 1:45 am

Remove redundant entries from the Cache Editor

Post by datacore.glenn »

Product, version and build:
PowerShell Studio 2016 64 bit (Build 5.2.129)

Operating system:
Windows 10 Pro 64 bit

PowerShell Version:
5.1 (Build 5.1.14393.206)

Hello,

I have a similar scenario to that described here: viewtopic.php?f=12&t=10752

I have created a simple script module as a test and over a number of iterations of that module, incremented "ModuleVersion" in the module's manifest file. To be clear, only one version is actually installed at any one time (to my knowledge) and only that one (lastest) is required to be installed. I am using the "Build Module" button in the Project pane to export the module on each update to the same folder location, overwritting the previous version.

However the Cache Editor continues to list all previous versions, including those that have now 'gone' and which aren't coming back:
RedundantCacheEntries.png
RedundantCacheEntries.png (5.8 KiB) Viewed 3465 times
Is there any way that I can clear the redundant entries down? Refreshing the local cache has no effect.

Thanks,
Glenn

DevinL
Site Admin
Posts: 1098
Joined: Mon Aug 17, 2015 2:25 pm

Re: Remove redundant entries from the Cache Editor

Post by DevinL »

At the moment there currently isn't an option to do this, however I've filed a feature request and will speak with the team as we've had a few others ask this as well.

As soon as I have some more information, I'll be sure to post it here.
DevinL
SAPIEN Technologies, Inc.

User avatar
datacore.glenn
Posts: 30
Joined: Mon Apr 09, 2012 1:45 am

Re: Remove redundant entries from the Cache Editor

Post by datacore.glenn »

Thank you, that would be appreciated.

I have observed another behaviour which might be symptomatic of a related issue? The Object Brower at times seems to have difficulty updating itself correctly too. The attached screenshot ("StaleCacheEntries.png") shows that a function within an existing module has been renamed, the module exported and the cache refreshed, yet the old method name persists.

I can workaround this by incrementing the ModuleVersion number in the module's manifest at the same time, whereupon a cache refresh does update the Object Browser entry for the module as expected. However even this won't handle the case where the signature of a function in an existing module is changed. The Help entry seems to persist the first discovered parameter list and I can't get it to update (see the screenshot "StaleCacheEntries(parameters).png").

Regards,
Glenn
Attachments
StaleCacheEntries(parameters).png
StaleCacheEntries(parameters).png (99.68 KiB) Viewed 3425 times
StaleCacheEntries.png
StaleCacheEntries.png (120.26 KiB) Viewed 3425 times

DevinL
Site Admin
Posts: 1098
Joined: Mon Aug 17, 2015 2:25 pm

Re: Remove redundant entries from the Cache Editor

Post by DevinL »

I've managed to reproduce the issue with the module exporting and the help.

I've filed an internal bug report and will update this post when I have some more information.
DevinL
SAPIEN Technologies, Inc.

DevinL
Site Admin
Posts: 1098
Joined: Mon Aug 17, 2015 2:25 pm

Re: Remove redundant entries from the Cache Editor

Post by DevinL »

As I was filing the bug report I just mentioned, I remembered that there's a Refresh Help context menu option available when you right click on the modules in the Object Browser.

I've updated my report to instead be a feature request to see if we can't refresh the help automatically when you export your module. In the meantime, after you make a change like this right click the module in the Object Browser and select Refresh Help:
Refresh_Help.png
Refresh_Help.png (31.23 KiB) Viewed 3413 times
DevinL
SAPIEN Technologies, Inc.

DevinL
Site Admin
Posts: 1098
Joined: Mon Aug 17, 2015 2:25 pm

Re: Remove redundant entries from the Cache Editor

Post by DevinL »

Hey datacore.glen,

I would like to let you know that in the latest build of PowerShell Studio we've added a new feature to the Cache Editor that will allow you to delete modules from the cache in order to avoid duplicates.

If you could update to the latest version (5.4.134) and give it a try, it'd be much appreciated!
DevinL
SAPIEN Technologies, Inc.