Skip to content

Need Graceful Response if executing PlatyPS commands from non-FileSystem provider #161

@jongeller

Description

@jongeller

discovered this when trying to run PlatyPS on the SQLPS module for SQL server. Part of getting the commands moves the runtime over to the SQL provider, PlatyPS fails dramatically at this point.

To Reproduce

Set-Location HKLM: #this puts you on a provider outside of the filesystem (registry)
New-ExternalHelp -Path <MdFilePath> -Output <outputPath>

Expected behavior

You get the help.xml (external help) expected.

Actual behavior

Get-MarkdownMetadata : Cannot bind argument to parameter 'Markdown' because it is an empty string.
At D:\GitHub Repos\platyPS\out\platyPS\platyPS.psm1:1155 char:48
+     $metadata = Get-MarkdownMetadata -markdown $markdown
+                                                ~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Get-MarkdownMetadata], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Get-MarkdownMetadata

Environment data

PlatyPS v0.5.0
Windows 10
PowerShell 5.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions