PowerShell / platyPS

Write PowerShell External Help in Markdown
MIT License
762 stars 148 forks source link

New-MarkdownHelp provides unclear error when module as no commands #615

Open Snozzberries opened 7 months ago

Snozzberries commented 7 months ago

Summary of the new feature / enhancement

If a module does not export any commands then New-MarkdownHelp throws $LocalizedData.ModuleNotFound.

A clearer error could be thrown.

Proposed technical implementation details (optional)

Reference to platyPS.psm1 line 277. GetCommands will return a measurable object.

$cmds = GetCommands ...
if ($cmds.Count -eq 0) { throw "New error" }
elseif (-not $cmds) { #line279 }