Photo by Nicolas Ladino Silva on Unsplash

Photo by Nicolas Ladino Silva on Unsplash

Documenting PowerShell Modules

Shapeshifter

Article from ADMIN 94/2026
By
PlatyPS simplifies the complex approach of adding help content to PowerShell modules by converting Markdown files into the PowerShell MAML format.

Markdown [1] has established itself in recent years as the standard for RTF-style documents. Thanks to the widespread use of the file format, editors with WYSIWYG functions are available for virtually any platform. The PlatyPS [2] Markdown-to-MAML converter helps you generate the documentation required for DIY PowerShell modules with minimal effort.

Setup and Compatibility

For this article, I worked on Windows 11 with PowerShell 7.5.3. The source code for the PlatyPS tool is available on GitHub [3]. The tool also is now available in a wide variety of PowerShell repositories. Note that running the Install-Module command downloads an outdated version of the product that is no longer maintained by Microsoft. To install the latest version, you need to enter

Install-PSResource -Name Microsoft.PowerShell.PlatyPS

At this point, PowerShell displays the usual security warning questioning the trustworthiness of the PowerShell Gallery (PSGallery) repository, so you need to acknowledge the warning to install and use the module. Bear in mind that content that mentions PlatyPS generally refers to the outdated version, whereas reference to Microsoft.PowerShell.PlatyPS in the Microsoft Developer Network (MSDN) or Microsoft documentation means the current version. I use the shorter PlatyPS throughout to mean the current version.

The next step involves importing two modules: the documentation generator and a relatively simple ADMTest module. I generated this module up front, but limited it to outputting messages at the command line and did not generate any help text, which is why the Get-Help call fails.


...

Use one of the options below to read the full article

Buy this article as PDF

Download Article PDF now with Express Checkout
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

Related content

comments powered by Disqus