Phil-Factor / PSYaml

A Powershell module to convert YAML documents to and from PowerShell objects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ConvertFrom-Yaml and Convert-YamlToJson Cmdlets do not work with string[] as returned by Get-Content

avonwyss opened this issue · comments

This can be worked around by using -Raw on the Get-Content Cmdlet, but it would be nice if the Cmdlets would behave the same as the original ones for Json, Csv and Xml, which seem to have no issue with string[] as returned from Get-Content.

Agreed, it would be a good idea to fix this. It is an aim to make these cmdlets as compatible as possible to the JSON ones

Just bumped into this myself, was rather confused and kept checking different YAML linters to see if I was doing anything wrong in my YAML.

ConvertTo-YAML (get-content 'MyPath\test.txt')

... produces ...

  • 'There was a Young Person of Crete,'
  • 'Whose toilette was far from complete;'
  • 'She dressed in a sack,'
  • 'Spickle-speckled with black,'
  • 'That ombliferous person of Crete.'
  • 'There was a Young Lady of Dorking,'
  • 'Who bought a large bonnet for walking;'
  • 'But its colour and size,'
  • 'So bedazzled her eyes,'
  • 'That she very soon went back to Dorking.'

is this wrong?

Aargh. Caught out by the markdown. Read those as dashes