Why
Configuration authors need to remove selected YAML data without converting the stream into lossy PowerShell objects. Existing object projection cannot preserve tags, complex keys, anchors, aliases, shared or recursive graphs, mapping order, or multiple-document boundaries.
What
Add Remove-YamlEntry as a pure text transformation that removes one or more entries selected by RFC 6901 JSON Pointer while preserving the unaffected YAML representation graph.
Acceptance criteria
- Accept YAML through mandatory pipeline-capable
-InputObject [string[]], aggregate records with LF as one stream, and return exactly one normalized LF-only string without a final newline
- Accept one or more mandatory JSON Pointers through
-Path [string[]]; an empty pointer selects a document root, and non-empty pointers require strict /, ~0, and ~1 syntax
- Select document zero by default through
-DocumentIndex, or apply every path independently to every original document with mandatory -AllDocuments
- Address mapping entries only through ordinal-matching scalar string keys; preserve but never coerce complex, non-string, or unknown-tagged keys
- Address sequences only with canonical non-negative decimal indexes and reject signs,
-, leading zeros, overflow, and malformed values
- Resolve and validate every target against an immutable deep-cloned representation graph before applying changes;
-IgnoreMissing skips only unresolved targets
- Coalesce duplicate logical targets reached through aliases, let ancestors subsume descendants, and remove sequence children and document roots in descending original index order
- Preserve unaffected tags, anchors, aliases, shared and cyclic identity, complex keys, mapping order, and document order; removing inside a shared collection is visible through every alias, and removing an alias edge removes only that edge
- Remove selected root documents and return an empty string when no documents remain
- Mirror parser and emitter safety controls for indentation, depth, nodes, aliases, scalar length, tag lengths, and numeric length; bound cloning, pointer parsing and resolution, coalescing, mutation, and output validation with classified errors
- Include complete command help, README and example usage, generated documentation and package export coverage, source and built-artifact tests, deterministic self-parse coverage, and cross-platform Process-PSModule validation
Why
Configuration authors need to remove selected YAML data without converting the stream into lossy PowerShell objects. Existing object projection cannot preserve tags, complex keys, anchors, aliases, shared or recursive graphs, mapping order, or multiple-document boundaries.
What
Add
Remove-YamlEntryas a pure text transformation that removes one or more entries selected by RFC 6901 JSON Pointer while preserving the unaffected YAML representation graph.Acceptance criteria
-InputObject [string[]], aggregate records with LF as one stream, and return exactly one normalized LF-only string without a final newline-Path [string[]]; an empty pointer selects a document root, and non-empty pointers require strict/,~0, and~1syntax-DocumentIndex, or apply every path independently to every original document with mandatory-AllDocuments-, leading zeros, overflow, and malformed values-IgnoreMissingskips only unresolved targets