Why
Automation that consumes YAML input often needs to know whether content is valid before acting on it, without wrapping ConvertFrom-Yaml in a try/catch just to check validity.
What
Add a Test-Yaml function that validates whether a given string or file content is well-formed YAML.
Acceptance criteria
Test-Yaml returns $true for valid YAML input and $false for invalid input, without throwing
- Accepts input via pipeline or
-InputObject, consistent with ConvertFrom-Yaml
Why
Automation that consumes YAML input often needs to know whether content is valid before acting on it, without wrapping
ConvertFrom-Yamlin atry/catchjust to check validity.What
Add a
Test-Yamlfunction that validates whether a given string or file content is well-formed YAML.Acceptance criteria
Test-Yamlreturns$truefor valid YAML input and$falsefor invalid input, without throwing-InputObject, consistent withConvertFrom-Yaml