Intellisense not working/cache not building

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 1 year and 10 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
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Intellisense not working/cache not building

Post by Alexander Riedel »

Vi guy here. What do you have selected in the platform selector and what does the object browser show? Feel free to post screenshots.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
PsCustomObject
Posts: 137
Last visit: Thu Mar 28, 2024 3:34 am

Re: Intellisense not working/cache not building

Post by PsCustomObject »

Oh finally somebody speaking my language :D

In the platform selector I've actually tried all 3 options, you know IT is not an exact science, all to the same result (cache not being "recognized").

What I have noticed, only now sorry :(, is that while I can see one of the modules in the object browser if I try to expand it no cmdlets are shown.

I have already tried to re-import the module from the Cache Editor manually.

All screenshots attached and again thanks!
Attachments
Selector.png
Selector.png (76.84 KiB) Viewed 2093 times
Object Browser.png
Object Browser.png (24.44 KiB) Viewed 2093 times
CacheEditor.png
CacheEditor.png (14.89 KiB) Viewed 2093 times
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Intellisense not working/cache not building

Post by Alexander Riedel »

Ok, thanks. First thing we need to find out if this is a module specific problem or a general problem, a.k.a. a condition called cache fubared.
So the first question is, does the Bitlocker module show cmdlets in the object browser and is the intellisense for that working?
Second one is, this Dental-Module, is that something I can download to test?
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
PsCustomObject
Posts: 137
Last visit: Thu Mar 28, 2024 3:34 am

Re: Intellisense not working/cache not building

Post by PsCustomObject »

So I just tested with the bitlocker module and can confirm intellisense is working as intended.

Module is something we develop internally and is highly customized to our requirements so is not published outside of our org, I can confirm that is used to work till my computer reinstallation.

I have to say, as I just chedked, this is affetcting other modules as well which are installed on my machine but empty in object exploreer among which AZ.batch or even SharePointPnPPowerShellOnline

All this modules do live inside Program Files but permissions are fine in terms of access/execute
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Intellisense not working/cache not building

Post by Alexander Riedel »

Go to this folder: C:\ProgramData\SAPIEN\PresetCache 2.1\ModuleCacheV5
Look at the files for a module name and version that does not work and note down the sizes or make a copy of the files elsewhere.
Then delete the .alias, .syntax, .cmdlets files for that module.
Rebuild the cache. See if the files are again the same or if it now works correctly.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
PsCustomObject
Posts: 137
Last visit: Thu Mar 28, 2024 3:34 am

Re: Intellisense not working/cache not building

Post by PsCustomObject »

Many thanks Alexander, I've tried this with couple of modules and essentially cache export is creating empty, 1kb, files I just opened the .cmdlets one I can see the [Module] preamble together with version and description while the syntax for example is empty.

This is happening for all modules appearing as "empty" in object browser.
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Intellisense not working/cache not building

Post by Alexander Riedel »

Interesting. Tell me one module I might have or can download.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Intellisense not working/cache not building

Post by Alexander Riedel »

The reason I am asking, this indicates that PowerShell can get the meta data of a module and it can see it existence. But loading it and getting exported cmdlets etc fails. That is usually an indication of missing runtimes or other pre-requisites. To determine dependencies it would be easiest if I can examine one right here.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
PsCustomObject
Posts: 137
Last visit: Thu Mar 28, 2024 3:34 am

Re: Intellisense not working/cache not building

Post by PsCustomObject »

Thansk for the explanation Alexander, I am facing the issue also with AZ modules (AZ.SQL, Az.SqlVirtualMachine, you can pickup one :)).

Funny enough AzureAD module is not affected by this as its cache is correctly built.

If there is any information, debug/anything I can provide please let me know.
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Intellisense not working/cache not building

Post by Alexander Riedel »

To verify, AZ.SQL can be loaded and used on your machine in Windows PowerShell 5.1 console and .NET Framework 4.7.2 or later is installed?
I will try this here later today or tomorrow and see what happens.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 1 year and 10 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.