Friday, January 2, 2015

Writing Help for DSC Resources


Windows PowerShell modules can include Help topics about the module and about the module members, such as cmdlets, providers, functions and scripts. The Get-Help cmdlet displays the module Help topics in the same format as it displays Help for other Windows PowerShell items, and users use standard Get-Help commands to get the Help topics. Using the help system you can include details like syntax overviews, detailed explanations, examples etc. for your PowerShell modules or DSC resources.
For DSC you can make use of the conceptual ("about") Help topic to describe the module and its members and to explain how the members can be used together to perform tasks. Conceptual Help topics are text files with Unicode (UTF-8) encoding. The file name must use the about_.help.txt format, such as about_xSampleDSCResource1.help.txt.
When you execute the Get-Help cmdlet, it will expect the module help topic files to be present in the directory of the script file for the module. For language specific help files it looks under the language specific sub directories of the module.

For my DSC resources I've used the following structure.
You can use the Get-Help About* cmdlet to see the available help files for modules.

For details use the Get-Help command as given below

This approach will help you maintain a clean DSC custom resource implementation

No comments: