-
Notifications
You must be signed in to change notification settings - Fork 76
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
Multiline String Support #58
Comments
Hi @ephos, First of all, my apologies for not getting back to you sooner. Secondly, I tried this: PS /home/gabriel> $data = @'
>> something:
>> name: test
>> key: |
>> -----BEGIN PGP MESSAGE-----
>> Version: GnuPG v2.0.22 (GNU/Linux)
>> blah
>> blah
>> blah
>> -----END PGP MESSAGE-----
>> '@
PS /home/gabriel> $x = ConvertFrom-Yaml $data
PS /home/gabriel> $x["something"]["key"]
-----BEGIN PGP MESSAGE-----
Version: GnuPG v2.0.22 (GNU/Linux)
blah
blah
blah
-----END PGP MESSAGE-----
PS /home/gabriel> ConvertTo-Yaml $x
something:
key: |
-----BEGIN PGP MESSAGE-----
Version: GnuPG v2.0.22 (GNU/Linux)
blah
blah
blah
-----END PGP MESSAGE-----
name: test Would you mind pasting an example of what you tried? |
Sorry I also just saw this reply! I just tried it out and it looks like it may work, I am going to try it tomorrow to see if it fixes what I saw when I originally opened the issue. Below is what I tried and it seems to honor the multi line string. $yaml = @"
something:
name: test
key: |
-----BEGIN PGP MESSAGE-----
Version: GnuPG v2.0.22 (GNU/Linux)
blah
blah
blah
-----END PGP MESSAGE-----
"@
# Deserialize
$object = $yaml | ConvertFrom-Yaml
# Updated value
$newPGPMsg = @"
-----BEGIN PGP MESSAGE-----
Version: GnuPG v2.0.22 (GNU/Linux)
foo
foo
foo
-----END PGP MESSAGE-----
"@
# Update the value
$object.something.key = $newPGPMsg
$object.something.key
# Serialize back to YAML
$object | ConvertTo-Yaml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, I saw another issue open and then closed by the person that opened it regarding this with no other comments.
Current state:
Desired state:
Apologies if it is something I am doing, I tried various options but couldn't seem to get it to handle the multiline string.
The text was updated successfully, but these errors were encountered: