Intellisense doesn't appear to be working

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 4 years and 4 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
gulmiguel
Posts: 19
Last visit: Sun Apr 30, 2023 12:52 pm

Intellisense doesn't appear to be working

Post by gulmiguel »

Product, version and build: PowerShell Studio 2019, Build 5.6.170
32 or 64 bit version of product: 64-bit
Operating system: Windows 10 Enterprise 64-bit

Over the past couple of days, I've been running into a situation which I don't understand. PSS has always functioned with Intellisense, a listing of potential cmdlets/parameters in a 'type ahead' fashion. Over the past few days, when I'm typing commands which I know are in my modules, I don't see that feature...instead I keep getting:
PSS Intellisense Error - 20191126.0738.jpg
PSS Intellisense Error - 20191126.0738.jpg (199.1 KiB) Viewed 3181 times
I haven't changed any settings and there haven't been any recent updates that I'm aware of. Can anyone explain this to me and what I should do to fix it?

Many thanks in advance,
Miguel
User avatar
brittneyr
Site Admin
Posts: 1654
Last visit: Wed Mar 27, 2024 1:54 pm
Answers: 39
Been upvoted: 30 times

Re: Intellisense doesn't appear to be working

Post by brittneyr »

If these modules that are not being recognized are new or are not listed in the Object Browser panel, you will need to rebuild the cache in order for the intellisense to work.
This can be done by going to to the ribbon (Home->Platform) and selecting the button named Rebuild Local Cache:
SPS_RebuildCache.png
SPS_RebuildCache.png (84.69 KiB) Viewed 3165 times
This process may take a few minutes depending on how many modules you have installed.
Brittney
SAPIEN Technologies, Inc.
User avatar
gulmiguel
Posts: 19
Last visit: Sun Apr 30, 2023 12:52 pm

Re: Intellisense doesn't appear to be working

Post by gulmiguel »

Hello Britney:

Thank you so much for your suggestion. I gave it a try and it looked like things were going to work. Intellisense did indeed come back. However, because I rebuilt the cache, I lost several of my modules; primary of which were my Active Directory related modules:
Sapien Module Listing.jpg
Sapien Module Listing.jpg (54.91 KiB) Viewed 3151 times
I went back and tried to rebuild my local cache in the hopes that my AD modules would return:
Sapien Build Cache Screen.jpg
Sapien Build Cache Screen.jpg (110.01 KiB) Viewed 3151 times
But they still didn't reappear. So then I figured I must have to rebuild again. So I was about to do it from the console using the part that you showed me. However, I think I discovered a part of the problem when I was about to do the 'rebuild' again to put my modules back, but I got this message:
Sapien Cache Warning.jpg
Sapien Cache Warning.jpg (27.56 KiB) Viewed 3151 times
Previously, I must have chosen "Yes" and that's when the modules went away. This time, I chose "No" and then I went to the setting on the same menu, just underneath it; saying "Reload Local Cache". I wanted to include that graphic, but the limit must be three (3) because it wouldn't let me include any other images.

Reload cache seems to have brought back my missing modules, but at some point, I want them in there permanently rather than have to add them each time I open PSP. Is there a way to keep them in place?

Thank you.
User avatar
brittneyr
Site Admin
Posts: 1654
Last visit: Wed Mar 27, 2024 1:54 pm
Answers: 39
Been upvoted: 30 times

Re: Intellisense doesn't appear to be working

Post by brittneyr »

When you modify the cache, its important that you follow these steps.
If you have modules that are not in the scope of the environmental variable PSModulePath, then those modules will need to be imported using the cache manager.
If you need a specific version of a module, this will also need to be specified in the cache manager as it defaults to the latest.
From this point, you would need to build the cache:
SPS-CacheEditor.png
SPS-CacheEditor.png (44.73 KiB) Viewed 3142 times
Then from the main application, you would need to reload the cache:
SPS_Reload-Cache.png
SPS_Reload-Cache.png (29.3 KiB) Viewed 3142 times
Reload simply pulls the new cache information into PowerShell Studio, otherwise you would need to restart the application in order to see the changes to the cache.
Unless you make additional changes to the modules you are using, you should not need to do this every time you open the application.
Brittney
SAPIEN Technologies, Inc.
User avatar
gulmiguel
Posts: 19
Last visit: Sun Apr 30, 2023 12:52 pm

Re: Intellisense doesn't appear to be working

Post by gulmiguel »

Thank you so much Britney. I did it just as you instructed and things seem to be more 'normal'. The ironic part of all this is that I have the full Sapien DevOps 2019 Suite and there's a tool in there that probably would have been quite useful. It's called the PowerShell Module Manager 2019. When I was spinning my wheels (before you got me on the correct path), I was trying to remember how to get to the PowerShell Gallery. It was while looking through the Tools menu that I saw the link for Module Manager, so I opened it. HOLY COW!!! I feel about 9 kinds of stupid right now. I know I'm a noob, but damn...I really need to spend more time with this stuff. You can't just open it up once in a while.

Anyway, I want to thank you for...
a) getting back to me so quickly, and
b) keeping me sane

I hope that at some point, I'll be able to return the favor; or at least buy you a good steak dinner. I really appreciate all that you've done.

Take care,
Miguel
This topic is 4 years and 4 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.