Skip to content

Commit 478ce7e

Browse files
Add comment-based help and inline parameter docs to Import-Yaml private helper
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 56337da commit 478ce7e

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

src/functions/private/Get-YamlTextEncoding.ps1

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,17 @@ function Get-YamlTextEncoding {
44
Creates a strict text encoding for YAML file input or output.
55
66
.DESCRIPTION
7-
Returns an encoding that throws when bytes or characters cannot be
8-
represented. The encoding preamble matches the public encoding name.
9-
10-
.PARAMETER Name
11-
The public YAML file encoding name.
7+
Maps the module's public encoding names to .NET encodings that throw on
8+
invalid bytes or characters. This keeps Import-Yaml file reads strict
9+
while preserving the selected byte-order-mark policy for callers.
1210
1311
.EXAMPLE
1412
Get-YamlTextEncoding -Name utf8
1513
1614
Returns strict UTF-8 without a byte order mark.
1715
18-
.INPUTS
19-
None.
20-
21-
.OUTPUTS
22-
System.Text.Encoding
16+
.LINK
17+
https://psmodule.io/Yaml/Functions/Import-Yaml/
2318
#>
2419
[OutputType(
2520
[System.Text.UTF8Encoding],
@@ -28,7 +23,8 @@ function Get-YamlTextEncoding {
2823
)]
2924
[CmdletBinding()]
3025
param (
31-
# Selects the strict decoder and its output preamble policy.
26+
# The public encoding token selects strict decoder behavior and the BOM
27+
# preamble policy required by file commands.
3228
[Parameter(Mandatory)]
3329
[ValidateSet('utf8', 'utf8BOM', 'utf16LE', 'utf16BE', 'utf32LE', 'utf32BE')]
3430
[string] $Name

0 commit comments

Comments
 (0)