[PSS 2018][Bug] Duplicate modules & commands

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 6 years and 2 weeks 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.
Bosparan
Posts: 290
Last visit: Fri Oct 08, 2021 11:59 am

[PSS 2018][Bug] Duplicate modules & commands

Post by Bosparan »

PSS Version: 2018 5.5.149 x64
OS Version: Windows 10 x64 1709
WMF Version: 5.1

Impact: Minor

Symptoms:
PowerShell Studio will detect each version of installed modules separately and list each command multiple times during Primal Sense

Reproducibility:
Install two different versions of the same module, then rebuild cache and check module list or type command from module
User avatar
mxtrinidad
Posts: 399
Last visit: Tue May 16, 2023 6:52 am

Re: [PSS 2018][Bug] Duplicate modules & commands

Post by mxtrinidad »

This is true. PowerShell Studio will list the same command if it exist across existing modules.

At the same time, Primalsense will display all command, and when you highlight the command it will show from which module is been used.
(See image)
Sapien_DupCmdlets_2018-02-28_8-36-07.jpg
Sapien_DupCmdlets_2018-02-28_8-36-07.jpg (47.89 KiB) Viewed 2955 times
There's a couple of ways to handle this issue:
1. Use the "Edit Cache" option to Enable/Disable" the module then "Build Cache" to refresh the Object Browser.
2. Or, you can add the module namespace to the cmdlet by using Ctrl-Shift-Space (ie. SqlServer\Invoke-SqlCmd).

Using Primalsense to pick the cmdlet, PowerShell Studio will add the "Import-Module" line that belongs to the command.
Sapien_DupCmdlets2_2018-02-28_8-36-07.jpg
Sapien_DupCmdlets2_2018-02-28_8-36-07.jpg (40.58 KiB) Viewed 2955 times

Hope this helps!
Bosparan
Posts: 290
Last visit: Fri Oct 08, 2021 11:59 am

Re: [PSS 2018][Bug] Duplicate modules & commands

Post by Bosparan »

Heya Max,

problem is, it lists it for every single copy of the same module (whether equal or different version numbers).
In some cases, that means I've got ten times the same command on the list, which is slightly inconvenient (it also doesn't tell me for which version it is, if picking different versions would make a difference, which I don't see coming).

Don't use auto-insert Import-Module, so I can't answer to that.

Not a big issue, but a lesser nuisance. For debugging purposes, I sometimes need to have different versions at hand, sometimes I'm just too lazy to clean them up.
Just think that picking the latest version of the same module (and ignoring older versions) would be the reasonable choice from a development perspective, given that currently I don't see there being a meaningful toolkit to select between which version to target.
User avatar
mxtrinidad
Posts: 399
Last visit: Tue May 16, 2023 6:52 am

Re: [PSS 2018][Bug] Duplicate modules & commands

Post by mxtrinidad »

I can tell you that we are working on a feature to better manage all installed modules.
I understand what you're saying!

And Yes! The other solution would be to cleanup all unwanted modules so you can work with only the ones you need.

It's a little tedious to cleanup. Using the "Edit Cache", remove all unwanted modules, and then do the "Build Cache".
All selected modules will remain listed in the "Object Browser" even exiting and restarting PowerShell Studio.

This will work until the next version gets updated, or if you click on the "Refresh Local Cache" option.

I'm sure we'll have something soon to address this issue.

Let me know if it works for you.
:)
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: [PSS 2018][Bug] Duplicate modules & commands

Post by davidc »

We released a new service build (v5.5.150). Please let us know if the issue persists.
David
SAPIEN Technologies, Inc.
This topic is 6 years and 2 weeks 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.