Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle null metadata hashtable #60

Closed
BernieWhite opened this issue Jun 10, 2019 · 0 comments · Fixed by #65
Closed

Handle null metadata hashtable #60

BernieWhite opened this issue Jun 10, 2019 · 0 comments · Fixed by #65
Labels
bug Something isn't working
Milestone

Comments

@BernieWhite
Copy link
Member

BernieWhite commented Jun 10, 2019

Describe the bug

When using the Metadata keyword`, the value passed may be null. When null is passed an exception is raised.

To Reproduce

Steps to reproduce the behaviour.

Document 'Example' {
    Metadata $Null
}

Expected behaviour

Metadata should gracefully handle null data by not adding any metadata and supressing the exception by default.

Error output

Invoke-PSDocument : Cannot bind argument to parameter 'Body' because it is null.
At line:1 char:18
+ ... s.Info | %{ Invoke-PSDocument -Path .\RuleHelp.Doc.ps1 -OutputPath .\ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Write-Error], InvokeDocumentException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Metadata,Invoke-PSDocument

Module in use and version:

  • Module: PSDocs
  • Version 0.6.1
@BernieWhite BernieWhite added the bug Something isn't working label Jun 10, 2019
BernieWhite added a commit that referenced this issue Sep 2, 2019
@BernieWhite BernieWhite mentioned this issue Sep 12, 2019
4 tasks
@BernieWhite BernieWhite added this to the v0.6.2 milestone Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant