PowerShell/platyPS

New-MarkdownHelp provides unclear error when module as no commands

Snozzberries opened this issue · 0 comments

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 }