Skip to content

Long hashtable values incorrectly wraps #12

@jeff1evesque

Description

@jeff1evesque

I have the following generic logic:

import-module psyaml

## local variables
$my_arr = @()
$my_hash = @{}
$blahs = @('one', 'two', 'three')
$something = @(@{Name = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'})

## generate output
foreach ($someValue in $something) {
    foreach ($blah in $blahs) {
        $my_hash += @{$blah = $someValue.Name}
    }
}
$my_arr += @{'zzzz' = $my_hash}

## convert to yaml
$my_arr | ConvertTo-YAML

I end up getting output that looks like:

---

  zzzz: 
    one: >
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 
    three: >
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 
    two: >
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

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