Update "Show Help" for modified module

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 7 years and 6 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
cgrace70
Posts: 46
Last visit: Tue Sep 28, 2021 4:39 pm

Update "Show Help" for modified module

Post by cgrace70 »

Product, version and build: PSS2016 v5.2.128
32 or 64 bit version of product: 64-bit
Operating system: Windows 7 Pro
32 or 64 bit OS: 64-bit
PowerShell Version: 5

This morning I began building a new PowerShell module (project). After I created the module I used the "Build Module" button and after a short bit the module appeared in the Object Browser with the cmdlets. The cmdlets are not located in the module itself. I dot-sourced each cmdlet in it's own .ps1 under a subfolder. This worked fine.
# dot-source all function files
Get-ChildItem -Path $PSScriptRoot\PSS\*.ps1 | Foreach-Object{ . $_.FullName }
$RestrictedFunctions = "Test-ElevatedShell", "Get-ReturnCode"
Export-ModuleMember –Function @(Get-Command –Module $ExecutionContext.SessionState.Module | Where-Object { $RestrictedFunctions -notcontains $_.name })
I made a change to a couple of the cmdlets scripts this afternoon by renaming a couple of the parameters. I updated the version number in the .psd1 file for the module and then used the "Build Module" button again. After the update I was able to confirm the version of the module using GET-MODULE -ListAvailable. I confirmed the new parameter names were accessible from PSS and the console. The cache file names contained the new version number and the appropriate information was embedded in them.

What I discovered is that if I right click on the cmdlet under the Object Browser and select Show Help, the old "Syntax" and "Parameters" are displayed from the module I generated this morning. How does the Help get rebuilt / updated? By putting the cmdlets in their own .ps1 file and .dot sourcing them; does this break what PSS is able to read, after the initial Help is generated?
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Update "Show Help" for modified module

Post by davidc »

You can refresh the cached help by using the Object Browser context menu:
Refresh Help.png
Refresh Help.png (20.11 KiB) Viewed 1683 times
It should update accordingly as long as PowerShell is able the display the help.
David
SAPIEN Technologies, Inc.
User avatar
cgrace70
Posts: 46
Last visit: Tue Sep 28, 2021 4:39 pm

Re: Update "Show Help" for modified module

Post by cgrace70 »

Thanks David. Once again, I am blind to what is staring me in the face. :oops:
This topic is 7 years and 6 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.