I'm trying to create an external MAML help file for a script Module. As a test I created a simple module called "ModTest" with 2 functions saved in a .psm1 file:
function Test-SqlScript2
{
}
function Out-SqlScript2
{
}
I saved the module in my user Modules directory ~\Documents\Modules\ModTest Next I created a subdirectory for a MAML file ~\Documents\Modules\ModTest\en-US The MAML file I'm using for testing is available here. I then started PowerShell and used Import-Module to import the module.
Unlike compiled cmdlets the placement of the file does not work by itself
So, next I tried adding the help link to the top of the script module, which also doesn't work:
<#
.ExternalHelp C:\Users\cmiller6\Documents\WindowsPowershell\Modules\ModTest\en-US\ModTest.help.xml
#>
function Test-SqlScript2
{
}
function Out-SqlScript2
{
Then I tried adding the help info to each function, which does work:
function Test-SqlScript2
{
<#
.ExternalHelp C:\Users\cmiller6\Documents\WindowsPowershell\Modules\ModTest\en-US\ModTest.help.xml
#>
}
function Out-SqlScript2
{
<#
.ExternalHelp C:\Users\cmiller6\Documents\WindowsPowershell\Modules\ModTest\en-US\ModTest.help.xml
#>
Two questions:
- Is it possible to create a script module level external MAML help OR do you need to specify the help link in each function?
- Although the documentation claims and blog posts indicate that the language specific folder i.e. en-US will be automatically searched when specifying a path (~/ModTest\ModTest.help.xml) I could not get the MAML file to resolve unless I included the explicit path (~/ModTest/en-US/ModTest.help.xml). Is this a bug? See the following links for documentation on get-help and language specific folders:
Writing Help for Windows PowerShell Modules PowerShell V2 External MAML Help