Giter Club home page Giter Club logo

Comments (2)

gabriel-samfira avatar gabriel-samfira commented on June 29, 2024

Hi @ChristopherGLewis

The string type does not have a value property. That is why you are getting a $null when testing:

PS /home/gabriel> $A = @{'Fred'=""}        
PS /home/gabriel> $tmp =  ConvertTo-Yaml $A
PS /home/gabriel> $tmp   
Fred: 

PS /home/gabriel> $tmp2 = ConvertFrom-Yaml $tmp
PS /home/gabriel> $tmp2

Name                           Value
----                           -----
Fred                           


PS /home/gabriel> $tmp2.Fred.GetType()

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     True     String                                   System.Object


PS /home/gabriel> $tmp2.Fred          

PS /home/gabriel> $tmp2.Fred -eq ""
True
PS /home/gabriel> $tmp2.Fred -eq $null
False

I will look into updating the YamlDotNet libraries and adjusting the code to use the new Builder(). This behavior may have been changed in more recent versions of YamlDotNet

from powershell-yaml.

gabriel-samfira avatar gabriel-samfira commented on June 29, 2024

Okay. I think both this, and the other bugs you opened can be fixed, if I can convince YamlDotNet to serialize strings using double or single quotes instead of bare words. Will look into it next week.

from powershell-yaml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.