5

The resources for writing xml help files for advanced functions seems very limited. I'm hoping to use xml-based help files, but it seems that this requires me to have one xml file per cmdlet, which is a huge number of xml files. Each cmdlet uses the .ExternalHelp to assign an xmlfile to it.

Is there a way put the help for many cmdlets into one file and then properly point each cmdlet to the correct part of the file?

Trevor Jordy
  • 598
  • 1
  • 7
  • 27
  • 3
    In `PSv4`+, yes. In `PSv3`, no. [Reference example](https://info.sapien.com/index.php/scripting/scripting-help/writing-xml-help-for-advanced-functions) – Maximilian Burszley Sep 11 '17 at 20:05
  • @TheIncorrigible1 how would one do this? I am using PSv4. How do you get each cmdlet to look at the correct part of the xml? – Trevor Jordy Sep 11 '17 at 21:13
  • Umm... you did notice the link in that comment, didn't you? – Ansgar Wiechers Sep 11 '17 at 21:37
  • @AnsgarWiechers I do but sadly I'm new to this and still don't understand what to use so that the cmdlet will know which part of the xml to use. It seems that you'd put the same .ExternalHelp for each cmdlet if all help is in the same xml. The different xml chunks don't seem to be labeled in a distinguishable way either, hopefully you can help clarify for me. Thanks for your patience. – Trevor Jordy Sep 11 '17 at 21:45

2 Answers2

0

Help links on writing PowerShell XML help topics for your scripts/cmdlets/functions:

Guidelines on writing help

Creating the cmdlet help file (I would suggest reading all the linked topics at the bottom of this page)

More on writing help

Maximilian Burszley
  • 18,243
  • 4
  • 34
  • 63
0

From what I've gathered from generating a help file using a PowerShell help file editor, if you have the #.ExternalHelp command in place, the file named properly, and the tag properly assigned to the cmdlet name, this should work. May also need the and to be correct as well. I recommend using an editor to generate a sample help file to examine, as other online examples seem to have be less in-depth.

Trevor Jordy
  • 598
  • 1
  • 7
  • 27