Page 1 of 1

Intellisense doesn't appear to be working

Posted: Tue Nov 26, 2019 6:40 am
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 2382 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,

Re: Intellisense doesn't appear to be working

Posted: Tue Nov 26, 2019 8:33 am
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 (84.69 KiB) Viewed 2366 times
This process may take a few minutes depending on how many modules you have installed.

Re: Intellisense doesn't appear to be working

Posted: Tue Nov 26, 2019 10:23 am
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 2352 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 2352 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 2352 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.

Re: Intellisense doesn't appear to be working

Posted: Tue Nov 26, 2019 12:04 pm
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 (44.73 KiB) Viewed 2343 times
Then from the main application, you would need to reload the cache:
SPS_Reload-Cache.png (29.3 KiB) Viewed 2343 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.

Re: Intellisense doesn't appear to be working

Posted: Tue Nov 26, 2019 2:32 pm
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,