Skip to content

🚀 [Feature]: YAML conversion now possible with ConvertFrom-Yaml and ConvertTo-Yaml#19

Open
Marius Storhaug (MariusStorhaug) wants to merge 22 commits intomainfrom
feature/2-convert-yaml-functions
Open

🚀 [Feature]: YAML conversion now possible with ConvertFrom-Yaml and ConvertTo-Yaml#19
Marius Storhaug (MariusStorhaug) wants to merge 22 commits intomainfrom
feature/2-convert-yaml-functions

Conversation

@MariusStorhaug
Copy link
Copy Markdown
Member

@MariusStorhaug Marius Storhaug (MariusStorhaug) commented May 2, 2026

YAML serialization now ships in PowerShell-native form. ConvertFrom-Yaml turns a valid YAML string into a [PSCustomObject] (or an ordered hashtable with -AsHashtable), and ConvertTo-Yaml serializes objects, hashtables, and arrays back into a YAML string. Both functions follow the parameter shape of ConvertFrom-Json / ConvertTo-Json and are also available under the Yml noun aliases (ConvertFrom-Yml / ConvertTo-Yml).

Scalar resolution aligns with YAML 1.2.2 (October 2021) — the latest revision of the spec — using its core schema. Only the lowercase canonical literals are recognised: true / false are booleans, null / ~ / empty are null, and everything else is a string unless it parses as a number.

New: ConvertFrom-Yaml

Parses a valid YAML string into a PowerShell object. Returns a [PSCustomObject] by default or an [ordered] hashtable with -AsHashtable. Use -NoEnumerate to keep a single-element top-level sequence as an array, and -Depth (default 1024) as a recursion safety net.

$yaml = @'
name: Alice
age: 30
skills:
  - PowerShell
  - YAML
'@

$yaml | ConvertFrom-Yaml
# name   skills              age
# ----   ------              ---
# Alice  {PowerShell, YAML}   30

The input must be a valid YAML string. The cmdlet does not read files or extract markdown frontmatter — that is the caller's responsibility (a separate Markdown module is the right place to extract frontmatter; the result can then be piped into ConvertFrom-Yaml). The YAML document-start (---) and document-end (...) markers are tolerated.

The supported YAML subset covers block-style mappings, block-style sequences, nested structures, single- and double-quoted strings (with \n, \t, \r, \\, \" escapes in double quotes), integers, doubles, lowercase booleans (true / false) and null (null / ~ / empty value). Full-line and inline # comments are ignored. YAML 1.1 boolean aliases (yes, no, on, off) and non-canonical case variants (True, TRUE, Null, NULL) are treated as plain strings, matching the YAML 1.2.2 core schema.

New: ConvertTo-Yaml

Serializes objects, hashtables/dictionaries, and arrays into a YAML block-style string. Mirrors ConvertTo-Json parameters where applicable.

[ordered]@{
    name   = 'Alice'
    age    = 30
    skills = @('PowerShell', 'YAML')
} | ConvertTo-Yaml
# name: Alice
# age: 30
# skills:
#   - PowerShell
#   - YAML
Parameter Default Purpose
-Depth 1024 Recursion limit. Deeper structures are rendered via .ToString().
-Indent 2 Spaces per nesting level.
-EnumsAsStrings off Render enum values as their string names instead of underlying integer.
-AsArray off Force a top-level YAML sequence even when a single object is provided.

Strings that match a YAML 1.2.2 core schema literal (true, false, null, ~) or that would otherwise parse as a number are quoted automatically — round-tripping $obj | ConvertTo-Yaml | ConvertFrom-Yaml returns equivalent values and types.

Aliases

Both functions register a noun alias for shorter invocation:

'name: Alice' | ConvertFrom-Yml
@{ name = 'Alice' } | ConvertTo-Yml

What's not in this version

The following are intentionally out of scope and remain as separate issues / outside the module's responsibility:

-Compress from ConvertTo-Json is intentionally omitted because the YAML analog is flow style, which is deferred.

Technical Details

  • Spec alignment: YAML 1.2.2 core schema. Scalar literal matching is case-sensitive (-ceq) so non-canonical variants (True, Yes, NULL, etc.) remain strings.
  • New public functions: src/functions/public/ConvertFrom-Yaml.ps1, src/functions/public/ConvertTo-Yaml.ps1. Aliases registered via [Alias()] attribute.
  • New private helpers in src/functions/private/:
    • ConvertFrom-YamlLineStream.ps1 — tokenizes input into indent-aware lines, skips comments, blank lines, and --- / ... document markers.
    • ConvertFrom-YamlNode.ps1 — recursive-descent parser for mappings, sequences, and scalars.
    • ConvertTo-YamlNode.ps1 — recursive emitter with quoting safety (Test-YamlPlainSafe, Format-YamlString, Format-YamlDoubleQuoted).
  • Pure PowerShell — no external library dependency.
  • Removed placeholder Get-PSModuleTest function and PSModuleTest.Tests.ps1.
  • README updated with module name, description, YAML 1.2.2 alignment statement, and current cmdlet usage examples.
  • Test coverage: 56 Pester tests across tests/ConvertFrom-Yaml.Tests.ps1 and tests/ConvertTo-Yaml.Tests.ps1, all passing locally. Includes scalars, mappings, sequences, -AsHashtable, -NoEnumerate, -AsArray, -Indent, -EnumsAsStrings, -Depth, document markers, comments, alias registration, round-trip conversion, and explicit YAML 1.2.2 core-schema scalar resolution tests verifying that Yes/On/NULL etc. remain strings.
  • Pre-1.0.0 SemVer: this introduces new public surface but classifies as Minor per the project's current 0.0.x versioning.
  • Implementation plan progress (issue Add ConvertFrom-Yaml and ConvertTo-Yaml functions #2): all tasks completed — both core functions, all tests, placeholder cleanup, example update, and README update with name/description and YAML 1.2.2 alignment statement.

@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title WIP: ConvertFrom-Yaml and ConvertTo-Yaml 🚀 [Feature]: YAML conversion now possible with ConvertFrom-Yaml and ConvertTo-Yaml May 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Fail ❌
NATURAL_LANGUAGE Fail ❌
POWERSHELL Fail ❌
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

Super-linter detected linting errors

For more information, see the GitHub Actions workflow run

Powered by Super-linter

MARKDOWN
/github/workspace/README.md:25:43 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
/github/workspace/README.md:26:84 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
NATURAL_LANGUAGE

/github/workspace/README.md
  48:46  ✓ error  Incorrect term: “markdown”, use “Markdown” instead  terminology

✖ 1 problem (1 error, 0 warnings, 0 infos)
✓ 1 fixable problem.
Try to run: $ textlint --fix [file]
POWERSHELL

�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSAlignAssignmentStatement          Warning      ConvertFro 105   Assignment st
                                                 m-Yaml.ps1       atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      ConvertFro 106   Assignment st
                                                 m-Yaml.ps1       atements are
                                                                  not aligned
PSAlignAssignmentStatement          Warning      ConvertFro 108   Assignment st
                                                 m-Yaml.ps1       atements are
                                                                  not aligned
PSUseOutputTypeCorrectly            Information  ConvertFro 114   The cmdlet 'C
                                                 m-Yaml.ps1       onvertFrom-Ya
                                                                  ml' returns a
                                                                  n object of t
                                                                  ype 'System.O
                                                                  bject[]' but
                                                                  this type is
                                                                  not declared
                                                                  in the Output
                                                                  Type attribut
                                                                  e.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseConsistentWhitespace           Warning      ConvertFro 181   Use space aft
                                                 m-Yaml.Tes       er a comma.
                                                 ts.ps1


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSAlignAssignmentStatement          Warning      ConvertTo- 73    Assignment st
                                                 Yaml.Tests       atements are
                                                 .ps1             not aligned
PSAlignAssignmentStatement          Warning      ConvertTo- 203   Assignment st
                                                 Yaml.Tests       atements are
                                                 .ps1             not aligned
PSAlignAssignmentStatement          Warning      ConvertTo- 205   Assignment st
                                                 Yaml.Tests       atements are
                                                 .ps1             not aligned
PSUseConsistentWhitespace           Warning      ConvertTo- 65    Use space aft
                                                 Yaml.Tests       er a comma.
                                                 .ps1


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseOutputTypeCorrectly            Information  ConvertFro 57    The cmdlet 'C
                                                 m-YamlLine       onvertFrom-Ya
                                                 Stream.ps1       mlLineStream'
                                                                   returns an o
                                                                  bject of type
                                                                   'System.Obje
                                                                  ct[]' but thi
                                                                  s type is not
                                                                   declared in
                                                                  the OutputTyp
                                                                  e attribute.
PSUseShouldProcessForStateChangingF Warning      ConvertFro 60    Function 'Rem
unctions                                         m-YamlLine       ove-YamlInlin
                                                 Stream.ps1       eComment' has
                                                                   verb that co
                                                                  uld change sy
                                                                  stem state. T
                                                                  herefore, the
                                                                   function has
                                                                   to support '
                                                                  ShouldProcess
                                                                  '.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseConsistentWhitespace           Warning      ConvertFro 286   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 287   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 288   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 289   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 291   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 286   Use space bef
                                                 m-YamlNode       ore open pare
                                                 .ps1             nthesis.
PSUseOutputTypeCorrectly            Information  ConvertFro 99    The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlMapping' re
                                                                  turns an obje
                                                                  ct of type 'S
                                                                  ystem.Collect
                                                                  ions.Speciali
                                                                  zed.OrderedDi
                                                                  ctionary' but
                                                                   this type is
                                                                   not declared
                                                                   in the Outpu
                                                                  tType attribu
                                                                  te.
PSUseOutputTypeCorrectly            Information  ConvertFro 173   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlSequence' r
                                                                  eturns an obj
                                                                  ect of type '
                                                                  System.Object
                                                                  []' but this
                                                                  type is not d
                                                                  eclared in th
                                                                  e OutputType
                                                                  attribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 240   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Boolean'
                                                                   but this typ
                                                                  e is not decl
                                                                  ared in the O
                                                                  utputType att
                                                                  ribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 243   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Boolean'
                                                                   but this typ
                                                                  e is not decl
                                                                  ared in the O
                                                                  utputType att
                                                                  ribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 249   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Int32' b
                                                                  ut this type
                                                                  is not declar
                                                                  ed in the Out
                                                                  putType attri
                                                                  bute.
PSUseOutputTypeCorrectly            Information  ConvertFro 253   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Int64' b
                                                                  ut this type
                                                                  is not declar
                                                                  ed in the Out
                                                                  putType attri
                                                                  bute.
PSUseOutputTypeCorrectly            Information  ConvertFro 259   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Double'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSUseOutputTypeCorrectly            Information  ConvertFro 263   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.String'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSProvideCommentHelp                Information  ConvertFro 42    The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlMapping' do
                                                                  es not have a
                                                                   help comment
                                                                  .
PSProvideCommentHelp                Information  ConvertFro 109   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlSequence' d
                                                                  oes not have
                                                                  a help commen
                                                                  t.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSReviewUnusedParameter             Warning      ConvertTo- 379   The parameter
                                                 YamlNode.p        'Options' ha
                                                 s1               s been declar
                                                                  ed but not us
                                                                  ed.
PSUseOutputTypeCorrectly            Information  ConvertTo- 251   The cmdlet 'G
                                                 YamlNode.p       et-YamlMappin
                                                 s1               gPairs' retur
                                                                  ns an object
                                                                  of type 'Syst
                                                                  em.Object[]'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSUseOutputTypeCorrectly            Information  ConvertTo- 260   The cmdlet 'G
                                                 YamlNode.p       et-YamlMappin
                                                 s1               gPairs' retur
                                                                  ns an object
                                                                  of type 'Syst
                                                                  em.Object[]'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSProvideCommentHelp                Information  ConvertTo- 58    The cmdlet 'T
                                                 YamlNode.p       est-YamlMappi
                                                 s1               ngType' does
                                                                  not have a he
                                                                  lp comment.
PSProvideCommentHelp                Information  ConvertTo- 72    The cmdlet 'T
                                                 YamlNode.p       est-YamlSeque
                                                 s1               nceType' does
                                                                   not have a h
                                                                  elp comment.
PSProvideCommentHelp                Information  ConvertTo- 84    The cmdlet 'C
                                                 YamlNode.p       onvertTo-Yaml
                                                 s1               Mapping' does
                                                                   not have a h
                                                                  elp comment.
PSProvideCommentHelp                Information  ConvertTo- 144   The cmdlet 'C
                                                 YamlNode.p       onvertTo-Yaml
                                                 s1               Sequence' doe
                                                                  s not have a
                                                                  help comment.
PSProvideCommentHelp                Information  ConvertTo- 345   The cmdlet 'F
                                                 YamlNode.p       ormat-YamlDou
                                                 s1               bleQuoted' do
                                                                  es not have a
                                                                   help comment
                                                                  .
PSProvideCommentHelp                Information  ConvertTo- 373   The cmdlet 'F
                                                 YamlNode.p       ormat-YamlKey
                                                 s1               ' does not ha
                                                                  ve a help com
                                                                  ment.
PSUseSingularNouns                  Warning      ConvertTo- 228   The cmdlet 'G
                                                 YamlNode.p       et-YamlMappin
                                                 s1               gPairs' uses
                                                                  a plural noun
                                                                  . A singular
                                                                  noun should b
                                                                  e used instea
                                                                  d.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Fail ❌
NATURAL_LANGUAGE Fail ❌
POWERSHELL Fail ❌
PRE_COMMIT Pass ✅
SPELL_CODESPELL Fail ❌
TRIVY Pass ✅
YAML Pass ✅

Super-linter detected linting errors

For more information, see the GitHub Actions workflow run

Powered by Super-linter

MARKDOWN
/github/workspace/README.md:26:43 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
/github/workspace/README.md:27:84 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
NATURAL_LANGUAGE

/github/workspace/README.md
  62:46  ✓ error  Incorrect term: “markdown”, use “Markdown” instead  terminology

✖ 1 problem (1 error, 0 warnings, 0 infos)
✓ 1 fixable problem.
Try to run: $ textlint --fix [file]
POWERSHELL

�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseOutputTypeCorrectly            Information  ConvertFro 114   The cmdlet 'C
                                                 m-Yaml.ps1       onvertFrom-Ya
                                                                  ml' returns a
                                                                  n object of t
                                                                  ype 'System.O
                                                                  bject[]' but
                                                                  this type is
                                                                  not declared
                                                                  in the Output
                                                                  Type attribut
                                                                  e.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseConsistentWhitespace           Warning      ConvertFro 198   Use space aft
                                                 m-Yaml.Tes       er a comma.
                                                 ts.ps1


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseOutputTypeCorrectly            Information  ConvertFro 57    The cmdlet 'C
                                                 m-YamlLine       onvertFrom-Ya
                                                 Stream.ps1       mlLineStream'
                                                                   returns an o
                                                                  bject of type
                                                                   'System.Obje
                                                                  ct[]' but thi
                                                                  s type is not
                                                                   declared in
                                                                  the OutputTyp
                                                                  e attribute.
PSUseShouldProcessForStateChangingF Warning      ConvertFro 60    Function 'Rem
unctions                                         m-YamlLine       ove-YamlInlin
                                                 Stream.ps1       eComment' has
                                                                   verb that co
                                                                  uld change sy
                                                                  stem state. T
                                                                  herefore, the
                                                                   function has
                                                                   to support '
                                                                  ShouldProcess
                                                                  '.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSProvideCommentHelp                Information  ConvertFro 42    The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlMapping' do
                                                                  es not have a
                                                                   help comment
                                                                  .
PSProvideCommentHelp                Information  ConvertFro 109   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlSequence' d
                                                                  oes not have
                                                                  a help commen
                                                                  t.
PSUseOutputTypeCorrectly            Information  ConvertFro 99    The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlMapping' re
                                                                  turns an obje
                                                                  ct of type 'S
                                                                  ystem.Collect
                                                                  ions.Speciali
                                                                  zed.OrderedDi
                                                                  ctionary' but
                                                                   this type is
                                                                   not declared
                                                                   in the Outpu
                                                                  tType attribu
                                                                  te.
PSUseOutputTypeCorrectly            Information  ConvertFro 173   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlSequence' r
                                                                  eturns an obj
                                                                  ect of type '
                                                                  System.Object
                                                                  []' but this
                                                                  type is not d
                                                                  eclared in th
                                                                  e OutputType
                                                                  attribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 239   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Boolean'
                                                                   but this typ
                                                                  e is not decl
                                                                  ared in the O
                                                                  utputType att
                                                                  ribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 240   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Boolean'
                                                                   but this typ
                                                                  e is not decl
                                                                  ared in the O
                                                                  utputType att
                                                                  ribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 245   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Int32' b
                                                                  ut this type
                                                                  is not declar
                                                                  ed in the Out
                                                                  putType attri
                                                                  bute.
PSUseOutputTypeCorrectly            Information  ConvertFro 249   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Int64' b
                                                                  ut this type
                                                                  is not declar
                                                                  ed in the Out
                                                                  putType attri
                                                                  bute.
PSUseOutputTypeCorrectly            Information  ConvertFro 255   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Double'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSUseOutputTypeCorrectly            Information  ConvertFro 259   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.String'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSUseConsistentWhitespace           Warning      ConvertFro 282   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 283   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 284   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 285   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 287   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 282   Use space bef
                                                 m-YamlNode       ore open pare
                                                 .ps1             nthesis.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSReviewUnusedParameter             Warning      ConvertTo- 379   The parameter
                                                 YamlNode.p        'Options' ha
                                                 s1               s been declar
                                                                  ed but not us
                                                                  ed.
PSUseOutputTypeCorrectly            Information  ConvertTo- 251   The cmdlet 'G
                                                 YamlNode.p       et-YamlMappin
                                                 s1               gPairs' retur
                                                                  ns an object
                                                                  of type 'Syst
                                                                  em.Object[]'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSUseOutputTypeCorrectly            Information  ConvertTo- 260   The cmdlet 'G
                                                 YamlNode.p       et-YamlMappin
                                                 s1               gPairs' retur
                                                                  ns an object
                                                                  of type 'Syst
                                                                  em.Object[]'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSUseSingularNouns                  Warning      ConvertTo- 228   The cmdlet 'G
                                                 YamlNode.p       et-YamlMappin
                                                 s1               gPairs' uses
                                                                  a plural noun
                                                                  . A singular
                                                                  noun should b
                                                                  e used instea
                                                                  d.
PSProvideCommentHelp                Information  ConvertTo- 58    The cmdlet 'T
                                                 YamlNode.p       est-YamlMappi
                                                 s1               ngType' does
                                                                  not have a he
                                                                  lp comment.
PSProvideCommentHelp                Information  ConvertTo- 72    The cmdlet 'T
                                                 YamlNode.p       est-YamlSeque
                                                 s1               nceType' does
                                                                   not have a h
                                                                  elp comment.
PSProvideCommentHelp                Information  ConvertTo- 84    The cmdlet 'C
                                                 YamlNode.p       onvertTo-Yaml
                                                 s1               Mapping' does
                                                                   not have a h
                                                                  elp comment.
PSProvideCommentHelp                Information  ConvertTo- 144   The cmdlet 'C
                                                 YamlNode.p       onvertTo-Yaml
                                                 s1               Sequence' doe
                                                                  s not have a
                                                                  help comment.
PSProvideCommentHelp                Information  ConvertTo- 345   The cmdlet 'F
                                                 YamlNode.p       ormat-YamlDou
                                                 s1               bleQuoted' do
                                                                  es not have a
                                                                   help comment
                                                                  .
PSProvideCommentHelp                Information  ConvertTo- 373   The cmdlet 'F
                                                 YamlNode.p       ormat-YamlKey
                                                 s1               ' does not ha
                                                                  ve a help com
                                                                  ment.
SPELL_CODESPELL
/github/workspace/tests/ConvertFrom-Yaml.Tests.ps1:46: nd ==> and, 2nd

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Fail ❌
PRE_COMMIT Pass ✅
SPELL_CODESPELL Fail ❌
TRIVY Pass ✅
YAML Pass ✅

Super-linter detected linting errors

For more information, see the GitHub Actions workflow run

Powered by Super-linter

POWERSHELL

�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseOutputTypeCorrectly            Information  ConvertFro 63    The cmdlet 'C
                                                 m-YamlLine       onvertFrom-Ya
                                                 Stream.ps1       mlLineStream'
                                                                   returns an o
                                                                  bject of type
                                                                   'System.Obje
                                                                  ct[]' but thi
                                                                  s type is not
                                                                   declared in
                                                                  the OutputTyp
                                                                  e attribute.
PSUseShouldProcessForStateChangingF Warning      ConvertFro 66    Function 'Rem
unctions                                         m-YamlLine       ove-YamlInlin
                                                 Stream.ps1       eComment' has
                                                                   verb that co
                                                                  uld change sy
                                                                  stem state. T
                                                                  herefore, the
                                                                   function has
                                                                   to support '
                                                                  ShouldProcess
                                                                  '.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSProvideCommentHelp                Information  ConvertFro 42    The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlMapping' do
                                                                  es not have a
                                                                   help comment
                                                                  .
PSProvideCommentHelp                Information  ConvertFro 109   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlSequence' d
                                                                  oes not have
                                                                  a help commen
                                                                  t.
PSUseOutputTypeCorrectly            Information  ConvertFro 99    The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlMapping' re
                                                                  turns an obje
                                                                  ct of type 'S
                                                                  ystem.Collect
                                                                  ions.Speciali
                                                                  zed.OrderedDi
                                                                  ctionary' but
                                                                   this type is
                                                                   not declared
                                                                   in the Outpu
                                                                  tType attribu
                                                                  te.
PSUseOutputTypeCorrectly            Information  ConvertFro 173   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlSequence' r
                                                                  eturns an obj
                                                                  ect of type '
                                                                  System.Object
                                                                  []' but this
                                                                  type is not d
                                                                  eclared in th
                                                                  e OutputType
                                                                  attribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 239   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Boolean'
                                                                   but this typ
                                                                  e is not decl
                                                                  ared in the O
                                                                  utputType att
                                                                  ribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 240   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Boolean'
                                                                   but this typ
                                                                  e is not decl
                                                                  ared in the O
                                                                  utputType att
                                                                  ribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 245   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Int32' b
                                                                  ut this type
                                                                  is not declar
                                                                  ed in the Out
                                                                  putType attri
                                                                  bute.
PSUseOutputTypeCorrectly            Information  ConvertFro 249   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Int64' b
                                                                  ut this type
                                                                  is not declar
                                                                  ed in the Out
                                                                  putType attri
                                                                  bute.
PSUseOutputTypeCorrectly            Information  ConvertFro 255   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Double'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSUseOutputTypeCorrectly            Information  ConvertFro 259   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.String'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSUseConsistentWhitespace           Warning      ConvertFro 282   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 283   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 284   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 285   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 287   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 282   Use space bef
                                                 m-YamlNode       ore open pare
                                                 .ps1             nthesis.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSReviewUnusedParameter             Warning      ConvertTo- 379   The parameter
                                                 YamlNode.p        'Options' ha
                                                 s1               s been declar
                                                                  ed but not us
                                                                  ed.
PSUseOutputTypeCorrectly            Information  ConvertTo- 251   The cmdlet 'G
                                                 YamlNode.p       et-YamlMappin
                                                 s1               gPairs' retur
                                                                  ns an object
                                                                  of type 'Syst
                                                                  em.Object[]'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSUseOutputTypeCorrectly            Information  ConvertTo- 260   The cmdlet 'G
                                                 YamlNode.p       et-YamlMappin
                                                 s1               gPairs' retur
                                                                  ns an object
                                                                  of type 'Syst
                                                                  em.Object[]'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSProvideCommentHelp                Information  ConvertTo- 58    The cmdlet 'T
                                                 YamlNode.p       est-YamlMappi
                                                 s1               ngType' does
                                                                  not have a he
                                                                  lp comment.
PSProvideCommentHelp                Information  ConvertTo- 72    The cmdlet 'T
                                                 YamlNode.p       est-YamlSeque
                                                 s1               nceType' does
                                                                   not have a h
                                                                  elp comment.
PSProvideCommentHelp                Information  ConvertTo- 84    The cmdlet 'C
                                                 YamlNode.p       onvertTo-Yaml
                                                 s1               Mapping' does
                                                                   not have a h
                                                                  elp comment.
PSProvideCommentHelp                Information  ConvertTo- 144   The cmdlet 'C
                                                 YamlNode.p       onvertTo-Yaml
                                                 s1               Sequence' doe
                                                                  s not have a
                                                                  help comment.
PSProvideCommentHelp                Information  ConvertTo- 345   The cmdlet 'F
                                                 YamlNode.p       ormat-YamlDou
                                                 s1               bleQuoted' do
                                                                  es not have a
                                                                   help comment
                                                                  .
PSProvideCommentHelp                Information  ConvertTo- 373   The cmdlet 'F
                                                 YamlNode.p       ormat-YamlKey
                                                 s1               ' does not ha
                                                                  ve a help com
                                                                  ment.
PSUseSingularNouns                  Warning      ConvertTo- 228   The cmdlet 'G
                                                 YamlNode.p       et-YamlMappin
                                                 s1               gPairs' uses
                                                                  a plural noun
                                                                  . A singular
                                                                  noun should b
                                                                  e used instea
                                                                  d.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseOutputTypeCorrectly            Information  ConvertFro 109   The cmdlet 'C
                                                 m-Yaml.ps1       onvertFrom-Ya
                                                                  ml' returns a
                                                                  n object of t
                                                                  ype 'System.O
                                                                  bject[]' but
                                                                  this type is
                                                                  not declared
                                                                  in the Output
                                                                  Type attribut
                                                                  e.
SPELL_CODESPELL
/github/workspace/tests/ConvertFrom-Yaml.Tests.ps1:46: nd ==> and, 2nd

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Fail ❌
PRE_COMMIT Pass ✅
SPELL_CODESPELL Fail ❌
TRIVY Pass ✅
YAML Pass ✅

Super-linter detected linting errors

For more information, see the GitHub Actions workflow run

Powered by Super-linter

POWERSHELL

�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseOutputTypeCorrectly            Information  ConvertFro 63    The cmdlet 'C
                                                 m-YamlLine       onvertFrom-Ya
                                                 Stream.ps1       mlLineStream'
                                                                   returns an o
                                                                  bject of type
                                                                   'System.Obje
                                                                  ct[]' but thi
                                                                  s type is not
                                                                   declared in
                                                                  the OutputTyp
                                                                  e attribute.
PSUseShouldProcessForStateChangingF Warning      ConvertFro 66    Function 'Rem
unctions                                         m-YamlLine       ove-YamlInlin
                                                 Stream.ps1       eComment' has
                                                                   verb that co
                                                                  uld change sy
                                                                  stem state. T
                                                                  herefore, the
                                                                   function has
                                                                   to support '
                                                                  ShouldProcess
                                                                  '.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSProvideCommentHelp                Information  ConvertFro 42    The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlMapping' do
                                                                  es not have a
                                                                   help comment
                                                                  .
PSProvideCommentHelp                Information  ConvertFro 109   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlSequence' d
                                                                  oes not have
                                                                  a help commen
                                                                  t.
PSUseOutputTypeCorrectly            Information  ConvertFro 99    The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlMapping' re
                                                                  turns an obje
                                                                  ct of type 'S
                                                                  ystem.Collect
                                                                  ions.Speciali
                                                                  zed.OrderedDi
                                                                  ctionary' but
                                                                   this type is
                                                                   not declared
                                                                   in the Outpu
                                                                  tType attribu
                                                                  te.
PSUseOutputTypeCorrectly            Information  ConvertFro 173   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlSequence' r
                                                                  eturns an obj
                                                                  ect of type '
                                                                  System.Object
                                                                  []' but this
                                                                  type is not d
                                                                  eclared in th
                                                                  e OutputType
                                                                  attribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 239   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Boolean'
                                                                   but this typ
                                                                  e is not decl
                                                                  ared in the O
                                                                  utputType att
                                                                  ribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 240   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Boolean'
                                                                   but this typ
                                                                  e is not decl
                                                                  ared in the O
                                                                  utputType att
                                                                  ribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 245   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Int32' b
                                                                  ut this type
                                                                  is not declar
                                                                  ed in the Out
                                                                  putType attri
                                                                  bute.
PSUseOutputTypeCorrectly            Information  ConvertFro 249   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Int64' b
                                                                  ut this type
                                                                  is not declar
                                                                  ed in the Out
                                                                  putType attri
                                                                  bute.
PSUseOutputTypeCorrectly            Information  ConvertFro 255   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Double'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSUseOutputTypeCorrectly            Information  ConvertFro 259   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.String'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSUseConsistentWhitespace           Warning      ConvertFro 282   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 283   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 284   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 285   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 287   Use space bef
                                                 m-YamlNode       ore open brac
                                                 .ps1             e.
PSUseConsistentWhitespace           Warning      ConvertFro 282   Use space bef
                                                 m-YamlNode       ore open pare
                                                 .ps1             nthesis.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSReviewUnusedParameter             Warning      ConvertTo- 379   The parameter
                                                 YamlNode.p        'Options' ha
                                                 s1               s been declar
                                                                  ed but not us
                                                                  ed.
PSUseOutputTypeCorrectly            Information  ConvertTo- 251   The cmdlet 'G
                                                 YamlNode.p       et-YamlMappin
                                                 s1               gPairs' retur
                                                                  ns an object
                                                                  of type 'Syst
                                                                  em.Object[]'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSUseOutputTypeCorrectly            Information  ConvertTo- 260   The cmdlet 'G
                                                 YamlNode.p       et-YamlMappin
                                                 s1               gPairs' retur
                                                                  ns an object
                                                                  of type 'Syst
                                                                  em.Object[]'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSProvideCommentHelp                Information  ConvertTo- 58    The cmdlet 'T
                                                 YamlNode.p       est-YamlMappi
                                                 s1               ngType' does
                                                                  not have a he
                                                                  lp comment.
PSProvideCommentHelp                Information  ConvertTo- 72    The cmdlet 'T
                                                 YamlNode.p       est-YamlSeque
                                                 s1               nceType' does
                                                                   not have a h
                                                                  elp comment.
PSProvideCommentHelp                Information  ConvertTo- 84    The cmdlet 'C
                                                 YamlNode.p       onvertTo-Yaml
                                                 s1               Mapping' does
                                                                   not have a h
                                                                  elp comment.
PSProvideCommentHelp                Information  ConvertTo- 144   The cmdlet 'C
                                                 YamlNode.p       onvertTo-Yaml
                                                 s1               Sequence' doe
                                                                  s not have a
                                                                  help comment.
PSProvideCommentHelp                Information  ConvertTo- 345   The cmdlet 'F
                                                 YamlNode.p       ormat-YamlDou
                                                 s1               bleQuoted' do
                                                                  es not have a
                                                                   help comment
                                                                  .
PSProvideCommentHelp                Information  ConvertTo- 373   The cmdlet 'F
                                                 YamlNode.p       ormat-YamlKey
                                                 s1               ' does not ha
                                                                  ve a help com
                                                                  ment.
PSUseSingularNouns                  Warning      ConvertTo- 228   The cmdlet 'G
                                                 YamlNode.p       et-YamlMappin
                                                 s1               gPairs' uses
                                                                  a plural noun
                                                                  . A singular
                                                                  noun should b
                                                                  e used instea
                                                                  d.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseOutputTypeCorrectly            Information  ConvertFro 108   The cmdlet 'C
                                                 m-Yaml.ps1       onvertFrom-Ya
                                                                  ml' returns a
                                                                  n object of t
                                                                  ype 'System.O
                                                                  bject[]' but
                                                                  this type is
                                                                  not declared
                                                                  in the Output
                                                                  Type attribut
                                                                  e.
SPELL_CODESPELL
/github/workspace/tests/ConvertFrom-Yaml.Tests.ps1:46: nd ==> and, 2nd

… escape handler, suppress false-positive ShouldProcess on Remove-YamlInlineComment, rename Get-YamlMappingPairs to singular noun, remove unused Options param from Format-YamlKey, use here-string in test to avoid codespell nd false positive
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Fail ❌
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

Super-linter detected linting errors

For more information, see the GitHub Actions workflow run

Powered by Super-linter

POWERSHELL

�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseOutputTypeCorrectly            Information  ConvertFro 63    The cmdlet 'C
                                                 m-YamlLine       onvertFrom-Ya
                                                 Stream.ps1       mlLineStream'
                                                                   returns an o
                                                                  bject of type
                                                                   'System.Obje
                                                                  ct[]' but thi
                                                                  s type is not
                                                                   declared in
                                                                  the OutputTyp
                                                                  e attribute.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseOutputTypeCorrectly            Information  ConvertFro 99    The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlMapping' re
                                                                  turns an obje
                                                                  ct of type 'S
                                                                  ystem.Collect
                                                                  ions.Speciali
                                                                  zed.OrderedDi
                                                                  ctionary' but
                                                                   this type is
                                                                   not declared
                                                                   in the Outpu
                                                                  tType attribu
                                                                  te.
PSUseOutputTypeCorrectly            Information  ConvertFro 173   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlSequence' r
                                                                  eturns an obj
                                                                  ect of type '
                                                                  System.Object
                                                                  []' but this
                                                                  type is not d
                                                                  eclared in th
                                                                  e OutputType
                                                                  attribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 239   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Boolean'
                                                                   but this typ
                                                                  e is not decl
                                                                  ared in the O
                                                                  utputType att
                                                                  ribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 240   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Boolean'
                                                                   but this typ
                                                                  e is not decl
                                                                  ared in the O
                                                                  utputType att
                                                                  ribute.
PSUseOutputTypeCorrectly            Information  ConvertFro 245   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Int32' b
                                                                  ut this type
                                                                  is not declar
                                                                  ed in the Out
                                                                  putType attri
                                                                  bute.
PSUseOutputTypeCorrectly            Information  ConvertFro 249   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Int64' b
                                                                  ut this type
                                                                  is not declar
                                                                  ed in the Out
                                                                  putType attri
                                                                  bute.
PSUseOutputTypeCorrectly            Information  ConvertFro 255   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.Double'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSUseOutputTypeCorrectly            Information  ConvertFro 259   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlScalar' ret
                                                                  urns an objec
                                                                  t of type 'Sy
                                                                  stem.String'
                                                                  but this type
                                                                   is not decla
                                                                  red in the Ou
                                                                  tputType attr
                                                                  ibute.
PSProvideCommentHelp                Information  ConvertFro 42    The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlMapping' do
                                                                  es not have a
                                                                   help comment
                                                                  .
PSProvideCommentHelp                Information  ConvertFro 109   The cmdlet 'C
                                                 m-YamlNode       onvertFrom-Ya
                                                 .ps1             mlSequence' d
                                                                  oes not have
                                                                  a help commen
                                                                  t.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseOutputTypeCorrectly            Information  ConvertTo- 251   The cmdlet 'G
                                                 YamlNode.p       et-YamlMappin
                                                 s1               gPair' return
                                                                  s an object o
                                                                  f type 'Syste
                                                                  m.Object[]' b
                                                                  ut this type
                                                                  is not declar
                                                                  ed in the Out
                                                                  putType attri
                                                                  bute.
PSUseOutputTypeCorrectly            Information  ConvertTo- 260   The cmdlet 'G
                                                 YamlNode.p       et-YamlMappin
                                                 s1               gPair' return
                                                                  s an object o
                                                                  f type 'Syste
                                                                  m.Object[]' b
                                                                  ut this type
                                                                  is not declar
                                                                  ed in the Out
                                                                  putType attri
                                                                  bute.
PSProvideCommentHelp                Information  ConvertTo- 58    The cmdlet 'T
                                                 YamlNode.p       est-YamlMappi
                                                 s1               ngType' does
                                                                  not have a he
                                                                  lp comment.
PSProvideCommentHelp                Information  ConvertTo- 72    The cmdlet 'T
                                                 YamlNode.p       est-YamlSeque
                                                 s1               nceType' does
                                                                   not have a h
                                                                  elp comment.
PSProvideCommentHelp                Information  ConvertTo- 84    The cmdlet 'C
                                                 YamlNode.p       onvertTo-Yaml
                                                 s1               Mapping' does
                                                                   not have a h
                                                                  elp comment.
PSProvideCommentHelp                Information  ConvertTo- 144   The cmdlet 'C
                                                 YamlNode.p       onvertTo-Yaml
                                                 s1               Sequence' doe
                                                                  s not have a
                                                                  help comment.
PSProvideCommentHelp                Information  ConvertTo- 345   The cmdlet 'F
                                                 YamlNode.p       ormat-YamlDou
                                                 s1               bleQuoted' do
                                                                  es not have a
                                                                   help comment
                                                                  .
PSProvideCommentHelp                Information  ConvertTo- 373   The cmdlet 'F
                                                 YamlNode.p       ormat-YamlKey
                                                 s1               ' does not ha
                                                                  ve a help com
                                                                  ment.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseOutputTypeCorrectly            Information  ConvertFro 108   The cmdlet 'C
                                                 m-Yaml.ps1       onvertFrom-Ya
                                                                  ml' returns a
                                                                  n object of t
                                                                  ype 'System.O
                                                                  bject[]' but
                                                                  this type is
                                                                  not declared
                                                                  in the Output
                                                                  Type attribut
                                                                  e.

…arations

- Add [PSProvideCommentHelp] comment blocks to 8 private helper functions:
  ConvertFrom-YamlMapping, ConvertFrom-YamlSequence, Test-YamlMappingType,
  Test-YamlSequenceType, ConvertTo-YamlMapping, ConvertTo-YamlSequence,
  Format-YamlDoubleQuoted, Format-YamlKey
- Add [OutputType] to ConvertFrom-YamlMapping, ConvertFrom-YamlSequence,
  ConvertFrom-YamlScalar
- Suppress PSUseOutputTypeCorrectly on 4 functions that use comma-unary
  operator to prevent collection unwrapping (ConvertFrom-YamlLineStream,
  ConvertFrom-YamlSequence, Get-YamlMappingPair, ConvertFrom-Yaml)
…escription, fix 'Id' to 'ID' in ConvertTo-Yaml example
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

@MariusStorhaug Marius Storhaug (MariusStorhaug) marked this pull request as ready for review May 2, 2026 21:07
Copilot AI review requested due to automatic review settings May 2, 2026 21:07
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds PowerShell-native YAML serialization/deserialization cmdlets (ConvertFrom-Yaml / ConvertTo-Yaml) plus Yml aliases, implemented in pure PowerShell with a focused YAML 1.2.2 core-schema subset and backed by new Pester coverage. It also removes the prior placeholder cmdlet/test and updates docs/examples to reflect the new module purpose.

Changes:

  • Added ConvertFrom-Yaml parser (line-stream tokenizer + recursive-descent node parser) with -AsHashtable, -NoEnumerate, and -Depth.
  • Added ConvertTo-Yaml emitter (recursive node writer) with -Depth, -Indent, -EnumsAsStrings, and -AsArray.
  • Replaced placeholder cmdlet/tests with YAML-focused tests, and updated README + examples.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/PSModuleTest.Tests.ps1 Removes placeholder Pester test.
tests/ConvertTo-Yaml.Tests.ps1 Adds Pester coverage for YAML emission + round-trip scenarios.
tests/ConvertFrom-Yaml.Tests.ps1 Adds Pester coverage for YAML parsing, options, comments/markers, and core-schema scalar rules.
src/functions/public/Get-PSModuleTest.ps1 Removes placeholder public function.
src/functions/public/ConvertTo-Yaml.ps1 New public YAML serializer cmdlet + alias.
src/functions/public/ConvertFrom-Yaml.ps1 New public YAML parser cmdlet + alias.
src/functions/private/ConvertTo-YamlNode.ps1 Adds recursive emitter + scalar formatting/quoting helpers.
src/functions/private/ConvertFrom-YamlNode.ps1 Adds recursive-descent parser for mappings/sequences/scalars.
src/functions/private/ConvertFrom-YamlLineStream.ps1 Adds tokenizer that strips comments/blank lines/markers and tracks indentation.
examples/General.ps1 Updates example usage to demonstrate YAML cmdlets.
README.md Replaces template placeholders with YAML module documentation and examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/functions/private/ConvertFrom-YamlNode.ps1 Outdated
Comment thread src/functions/private/ConvertFrom-YamlNode.ps1 Outdated
Comment thread src/functions/public/ConvertTo-Yaml.ps1
The PSModule SourceCode test suite enforces that each .ps1 file contains exactly
one function whose name matches the filename. The three private helper files each
contained multiple helper functions, causing FunctionCount and FunctionName test
failures on all platforms.

Split into 16 individual files:
- ConvertFrom-YamlLineStream.ps1: extracted Remove-YamlInlineComment
- ConvertFrom-YamlNode.ps1: extracted ConvertFrom-YamlMapping,
  ConvertFrom-YamlSequence, Find-YamlMappingColon, ConvertFrom-YamlScalar,
  Expand-YamlDoubleQuoted
- ConvertTo-YamlNode.ps1: extracted Test-YamlMappingType, Test-YamlSequenceType,
  ConvertTo-YamlMapping, ConvertTo-YamlSequence, Get-YamlMappingPair,
  Format-YamlScalar, Format-YamlString, Format-YamlDoubleQuoted, Format-YamlKey,
  Test-YamlPlainSafe

All 56 Pester tests pass locally.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

…se [pscustomobject] cast to handle member name collisions

- Keys like true/false/null/~ are now preserved as literal strings instead of being
  type-resolved then cast back (which changed true->True, null->empty string)
- Quoted keys still have their escapes expanded correctly
- Replace Add-Member loop with [pscustomobject]$map cast to avoid errors when
  keys collide with built-in member names like ToString/GetType
- Add 3 tests: YAML-special keys, quoted key escapes, member name collision keys
Copilot AI review requested due to automatic review settings May 2, 2026 22:25
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/functions/private/ConvertTo-YamlMapping.ps1
Comment thread src/functions/private/ConvertTo-YamlSequence.ps1
Comment thread src/functions/private/ConvertTo-YamlNode.ps1
Comment thread src/functions/private/ConvertFrom-YamlScalar.ps1
Comment thread src/functions/public/ConvertFrom-Yaml.ps1
Comment thread src/functions/private/ConvertFrom-YamlScalar.ps1
…} round-tripping

- Fix if/else expressions that collapsed empty arrays to $null (PowerShell
  unrolls @() to nothing in expression output). Converted to statement form
  in ConvertTo-YamlMapping, ConvertTo-YamlSequence, ConvertTo-YamlNode,
  Get-YamlMappingPair, and ConvertTo-Yaml.
- Add indentation to empty {} and [] output in ConvertTo-YamlMapping and
  ConvertTo-YamlSequence so nested empty collections serialize correctly.
- Add indentation to depth-exceeded branch in ConvertTo-YamlNode.
- Add inline empty-collection checks in ConvertTo-YamlSequence for nested
  mapping/sequence values within sequence-item-mappings.
- Recognize {} and [] inline literals in ConvertFrom-YamlMapping and
  ConvertFrom-YamlSequence to restore round-trip fidelity.
- Add 17 new tests: empty collection rendering, depth-exceeded indentation,
  {} / [] parsing, and round-trip preservation of empty collections.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/functions/private/ConvertFrom-YamlSequence.ps1
Comment thread src/functions/private/ConvertFrom-YamlScalar.ps1
Comment thread tests/ConvertTo-Yaml.Tests.ps1 Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

…dent, test array IndexOf

Thread r3179984727 (ConvertFrom-YamlSequence): inline mapping child indent was hardcoded to
Indent+2, breaking continuation lines when extra spaces follow the dash (e.g. '-   a: 1').
Fixed by computing extraSpaces from leading spaces in afterDash and setting
childIndent = Indent + 2 + extraSpaces and stripping those spaces from the synthetic
Content. Added test 'Parses sequence inline mappings with extra spaces after the dash'.

Thread r3179984765 (ConvertFrom-YamlScalar): [double]::TryParse with NumberStyles.Float
accepts NaN, Infinity, -Infinity etc., which are .NET-specific and not part of the YAML 1.2.2
core schema (the spec uses .inf/.nan dot-prefix forms). Added a pre-guard regex
-imatch '^[+-]?(infinity|nan)$' to return these as plain strings before TryParse.
Added test 'Treats .NET-specific special float tokens as strings (YAML 1.2.2)'.

Thread r3179984792 (ConvertTo-Yaml.Tests.ps1): string arrays from -split have no instance
IndexOf() method; the call would throw at runtime. Replaced \.IndexOf(\) with
[array]::IndexOf(\, \).
Copilot AI review requested due to automatic review settings May 4, 2026 07:54
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/functions/public/ConvertFrom-Yaml.ps1
Comment thread src/functions/private/ConvertFrom-YamlMapping.ps1 Outdated
Comment thread src/functions/private/ConvertFrom-YamlMapping.ps1 Outdated
- ConvertFrom-YamlMapping: support indentless sequences (e.g. key:\n- a\n- b)
  where the sequence starts at the same indent as the parent mapping key.
  Removes misleading comment that claimed strict indentation was required.
- ConvertFrom-Yaml: add post-parse check that all preprocessed lines were
  consumed. Throws a terminating error with the first unconsumed line number
  and content when trailing content is detected.
- Tests: 4 new tests — indentless sequences (3 variants), unconsumed content.
  All 129 tests pass.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Fail ❌
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

Super-linter detected linting errors

For more information, see the GitHub Actions workflow run

Powered by Super-linter

POWERSHELL

�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSAvoidLongLines                    Warning      ConvertFro 111   Line exceeds
                                                 m-Yaml.ps1       the configure
                                                                  d maximum len
                                                                  gth of 150 ch
                                                                  aracters

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/functions/private/Expand-YamlDoubleQuoted.ps1
Comment thread src/functions/public/ConvertFrom-Yaml.ps1 Outdated
Comment thread README.md Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/functions/private/ConvertTo-YamlNode.ps1 Outdated
Comment thread src/functions/private/ConvertFrom-YamlLineStream.ps1 Outdated
Comment thread tests/ConvertFrom-Yaml.Tests.ps1
Comment thread tests/ConvertTo-Yaml.Tests.ps1 Outdated
…n, strengthen empty-array and unsigned-enum test assertions
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/functions/private/Find-YamlMappingColon.ps1
Comment thread src/functions/private/Remove-YamlInlineComment.ps1
…ent for plain scalars

Quote characters inside plain (unquoted) scalars were incorrectly toggling
quote state, causing colon detection and inline comment stripping to fail for
values like owner's: Bob or name: O'Connor  # comment.

Added inPlain flag to both functions so quote characters only open quoted
regions at token boundaries (position 0, after ': ', after '- '), not mid-token
in plain scalars. Added 5 tests covering apostrophe/double-quote in plain keys,
values, and sequence items with inline comments.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Fail ❌
PRE_COMMIT Pass ✅
SPELL_CODESPELL Fail ❌
TRIVY Pass ✅
YAML Pass ✅

Super-linter detected linting errors

For more information, see the GitHub Actions workflow run

Powered by Super-linter

POWERSHELL

�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseConsistentWhitespace           Warning      Remove-Yam 18    Use space bef
                                                 lInlineCom       ore and after
                                                 ment.ps1          binary and a
                                                                  ssignment ope
                                                                  rators.


�[32;1mRuleName                           �[0m�[32;1m Severity    �[0m�[32;1m ScriptName�[0m�[32;1m Line �[0m�[32;1m Message�[0m
�[32;1m--------                           �[0m �[32;1m--------    �[0m �[32;1m----------�[0m �[32;1m---- �[0m �[32;1m-------�[0m
PSUseConsistentWhitespace           Warning      Find-YamlM 21    Use space bef
                                                 appingColo       ore and after
                                                 n.ps1             binary and a
                                                                  ssignment ope
                                                                  rators.
SPELL_CODESPELL
/github/workspace/tests/ConvertFrom-Yaml.Tests.ps1:691: ue ==> use, due

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

string. Mirrors the parameter shape of `ConvertTo-Json` where applicable.

Out of scope for this version: flow style (`[a, b]`, `{a: 1}`), block scalars
(`|`, `>`), anchors/aliases, tags, and timestamp formatting.
Comment on lines +45 to +53
# Float.
# Reject .NET-specific special float tokens that are not part of the YAML 1.2.2 core schema.
# Core schema uses .inf/.Inf/.INF/.nan/.NaN/.NAN (dot-prefix form). The bare NaN/Infinity
# words are accepted by [double]::TryParse but must remain plain strings per the spec.
if ($value -imatch '^[+-]?(infinity|nan)$') { return $value }
$dblVal = 0.0
if ([double]::TryParse($value, [System.Globalization.NumberStyles]::Float, [cultureinfo]::InvariantCulture, [ref] $dblVal)) {
return $dblVal
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ConvertFrom-Yaml and ConvertTo-Yaml functions

2 participants