Module contents fails to cache

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.
This topic is 7 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
OldLost
Posts: 55
Last visit: Wed Feb 21, 2018 8:00 am

Module contents fails to cache

Post by OldLost »

PowerShell Studio 2016 v5.2.128 x64
Windows Server 2012 R2 64bit

I have a module that I recently updated. It has a PS1M and PS1D file, and I did change the version number in the PS1D file since some of the module's function's parameters changed. I can import the module into a PS session and use the functions, etc. that it contains, so it is a valid module file free from syntax errors.

Now PowerShell Studio fails to index (cache) the module's contents. The module name appears under the Modules category in the Object Browser, but there is nothing under it, and all occurrences of function names in PS1 files that import the module show up as unknown.

I have verified this on a second machine with a fresh install of PowerShell Studio and the module as the only one under MyDocuments/WindowsPowerShell/Modules folder. The module's name is being listed in the Object Browser so it is recognizing that the module is there, but it is not caching any of the module's functions, variables, or aliases.

Any suggestions on what I can do about this issue?
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: Module contents fails to cache

Post by DevinL »

After you made your changes did you happen to refresh the cache at all?

Usually, for the updated functions or parameters to appear you have to rebuild the cache with this button in the ribbon:
Rebuild_Cache.png
Rebuild_Cache.png (16.21 KiB) Viewed 3118 times
If after rebuilding your cache the updates still aren't appearing, could you upload your module so we can reproduce this on our end? If you don't wish for the code to be public you may upload the module to https://www.sapien.com/support/upload and we'll see what we can do.
DevinL
SAPIEN Technologies, Inc.
User avatar
OldLost
Posts: 55
Last visit: Wed Feb 21, 2018 8:00 am

Re: Module contents fails to cache

Post by OldLost »

Indeed I would not want it public, so have uploaded it as requested.
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: Module contents fails to cache

Post by DevinL »

I've received the module and am performing some tests on my end.

As soon as I have some more information I'll be sure to post it here for you.
DevinL
SAPIEN Technologies, Inc.
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: Module contents fails to cache

Post by DevinL »

So far I've been unable to reproduce this as my PowerShell Studio install is caching the functions and parameter info as expected. I even added a $TestValue property to the Test-Online function and exported the module then it appeared in PrimalSense:
Tracker_Module.png
Tracker_Module.png (113.12 KiB) Viewed 3097 times
This was tested on a Windows 10 machine though so I'm going to test on a Windows Server 2012 VM next. However, can you provide the output for your $PSVersionTable so that I can make sure my VM is running the same version as you?
DevinL
SAPIEN Technologies, Inc.
User avatar
OldLost
Posts: 55
Last visit: Wed Feb 21, 2018 8:00 am

Re: Module contents fails to cache

Post by OldLost »

Here is the output of my $PSVersionTable variable:
  1. Name                           Value                                                                                                                            
  2. ----                           -----                                                                                                                            
  3. PSVersion                      5.0.10586.117                                                                                                                    
  4. PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                          
  5. BuildVersion                   10.0.10586.117                                                                                                                    
  6. CLRVersion                     4.0.30319.42000                                                                                                                  
  7. WSManStackVersion              3.0                                                                                                                              
  8. PSRemotingProtocolVersion      2.3                                                                                                                              
  9. SerializationVersion           1.1.0.1
Is it possible it has something to do with my settings? I've uploaded my settings.xml file to your site as well just in case.
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: Module contents fails to cache

Post by DevinL »

I doubt it's related to your settings as I've been unable to get the module to cache properly on Windows Server 2012 R2 running that exact version of PowerShell. I'm going to speak to the developers about this and see what we can do to get it fixed.

In the meantime, I did notice that upgrading to PowerShell 5.1 did fix the issue and I was able to get your functions to appear in the Object Browser as expected. If this is an option, I suggest giving it a try. If not, then please be patient while we figure out what's actually causing this.
DevinL
SAPIEN Technologies, Inc.
User avatar
OldLost
Posts: 55
Last visit: Wed Feb 21, 2018 8:00 am

Re: Module contents fails to cache

Post by OldLost »

Thanks DevinL. Good to know it's not just me. :)

Since WMF 5.1 is available only in preview form currently I'm afraid I will not be able to go that route at this time. Will look forward to hearing what the devs find and if it might be fixed in an upcoming version release.
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: Module contents fails to cache

Post by DevinL »

Hey OldLost,

With the 2017 build of PowerShell Studio, we made some changes to the CacheBuilder that just might fix this issue.

If you could update to the latest version (5.4.134) and try rebuilding your cache, it'd be nice to know if you can rebuild your cache and resolve this issue.
DevinL
SAPIEN Technologies, Inc.
This topic is 7 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.