Skip to content

Bug: $false as Boolean value creates an empty output #30

@Fishy78

Description

@Fishy78

Hi there:

Found a small issue in CovertTo-Yaml.ps1:

        # if it is null return null
        If ( !($inputObject) )

Should be:

        # if it is null return null
        If ( $inputObject -eq $null )

Reason:
If the object itself is "$false", it will return an empty yaml value

How to reproduce:

$test = [PSCustomObject]@{TestValue = $false }
ConvertTo-Yaml $test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions