Access help for script installed from PSRepository

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

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 5 years and 3 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.
Locked
User avatar
renenielsen
Posts: 13
Last visit: Thu Feb 16, 2023 8:04 am

Access help for script installed from PSRepository

Post by renenielsen »

WMF: 5.1
Windows 10 (latest)

Issue: I have written a script with comment based help. I verified the script as well as its comment based help (using get-help .\foo.ps1) before publishing it (had to migrate the comment based help into a <#psscriptinfo block) as well as associated modules to a PSRepository that was created on the local LAN (i.e., created a network share and used Register-PSRepository to register it as a repository). I then installed the modules and script (i.e., Install-Module -repository & Install-Script -repository) and things work fine...except I seem to be unable to access the comment based help in the installed script.

Note that after an install of the script from the PSRepository the script is executable using its name (no longer requires the path syntax as the script install makes it known to the engine). So using "get-help scriptname" only returns a one line parameter format information (i.e., get-help foo; foo.ps1 [-Verify] [-Info] [<CommonParameters>]). This is true even if I navigate into the installed folder (under C:\Program Files\PowerShell\Scripts) and use get-help with the .\ prefix.

I notice a difference between my base, unpublished script and its published counterpart in that the script metadata is now in a <#psscriptinfo comment block versus the older format of plain comment based help.

So my question becomes, how can I access comment based help that is within a <#pscriptinfo block once a publish script has been installed?

TIA
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Access help for script installed from PSRepository

Post by jvierra »

Without your code it is not possible to guess at the issue. You can start by reading the following very carefully.

https://www.sapien.com/blog/2015/02/18/ ... ased-help/

I would also suggest creating a very simple module with one function and testing it until you find what you are doing that is causing the issue.
This topic is 5 years and 3 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.
Locked