PowerCLI cmdlets are not displayed in autocomplete

Use this forum to ask questions after your subscription maintenance expires or before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE 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.
This topic is 9 years 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
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: PowerCLI cmdlets are not displayed in autocomplete

Post by davidc »

The mechanism to cache snapins has been changed do the volatile nature of some snapins which caused PowerShell and the caching process to terminate prematurely. This is way we provide a pre-cache of snapins. Modules on the other hand do not suffer from the same limitations.

David
David
SAPIEN Technologies, Inc.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: PowerCLI cmdlets are not displayed in autocomplete

Post by davidc »

What version is the vmware.vimautomation.core snapin on your machine?

I see we do have a precache file for it.

David
David
SAPIEN Technologies, Inc.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: PowerCLI cmdlets are not displayed in autocomplete

Post by davidc »

Can you check if you have these files?

C:\ProgramData\SAPIEN\CachedData 2014\Local Machine\ModuleCacheV2\VMware.VimAutomation.Core.5.1.0.0.cmdlets
C:\ProgramData\SAPIEN\CachedData 2014\Local Machine\ModuleCacheV2\VMware.VimAutomation.Core.5.1.0.0.syntax
C:\ProgramData\SAPIEN\CachedData 2014\Local Machine\ModuleCacheV2\VMware.VimAutomation.Core.5.1.0.0.alias

And does it match your installed version?

David
David
SAPIEN Technologies, Inc.
User avatar
MaureenC
Posts: 30
Last visit: Sun Mar 14, 2021 12:36 pm

Re: PowerCLI cmdlets are not displayed in autocomplete

Post by MaureenC »

David,

I do have those files on my machine.

I am not sure what you mean by my installed version. I have PowerCLI 5.0.1 and those cmdlets look like PowerCLI 5.1

Is that what you're asking? I could drop 5.1 on my development environment and just be sensitive to using the 5.0 cmdlets, but my production environment will have PowerCLI 5.0.

Is there any way I can get the Precached for 5.0?
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: PowerCLI cmdlets are not displayed in autocomplete

Post by davidc »

Ok that is it. The version you have doesn't match our cached version.

Try this:

Go to the following folder:
C:\ProgramData\SAPIEN\CachedData 2014\Local Machine

Open or create the snapins.cache file for the platform desired.
For example, for PowerShell V3 64 Bit the file will be named:

PowerShell64V3.Snapins.Cache


Add the following lines:
VMware.VimAutomation.Core|5.1.0.0 |
VMware.VimAutomation.License|1.0.0.0|
VMware.DeployAutomation|5.1.0.1786|
VMware.VimAutomation.Vds5.1.0.0 |

If you already have entries, update the version numbers to match the pre-cache version listed above.

Then save the file.

Do the same for the other platforms if necessary, such as PowerShell32V3.Snapins.Cache.

Now run the following in a command line or PowerShell.

CacheBuilder64.exe /ASSEMBLEONLY
CacheBuilder32.exe /ASSEMBLEONLY

Note: The cachebuilder64.exe and cachebuilder32.exe are located in the same directory as PowerShell Studio.

Then open PowerShell Studio and the snapins should appear in the PowerShell Browser (Object Browser Panel).

David
David
SAPIEN Technologies, Inc.
User avatar
MaureenC
Posts: 30
Last visit: Sun Mar 14, 2021 12:36 pm

Re: PowerCLI cmdlets are not displayed in autocomplete

Post by MaureenC »

David,
That fixed it! Thank you so much for your help.

Maureen
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: PowerCLI cmdlets are not displayed in autocomplete

Post by davidc »

Important Note: Version 4.1.56 of PowerShell Studio 2014 changes the location of the cache to the following user specific folder:

C:\Users\<username>\AppData\Roaming\SAPIEN\CachedData 2014\

You will need to manually re-add the snapins after installing this update.

David
David
SAPIEN Technologies, Inc.
User avatar
mamaro
Posts: 3
Last visit: Tue Jun 09, 2015 12:26 pm

Re: PowerCLI cmdlets are not displayed in autocomplete

Post by mamaro »

I am experiencing the same issue. Did you get this resolved?
This topic is 9 years 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.