@@ -12,40 +12,6 @@ function ConvertFrom-Yaml {
1212 Pipeline strings are joined with a line feed and parsed as one stream,
1313 which supports Get-Content. Each YAML document is written separately.
1414
15- . PARAMETER Yaml
16- YAML text. Multiple pipeline records are joined with a line feed and
17- parsed as one YAML stream.
18-
19- . PARAMETER AsHashtable
20- Returns mappings as insertion-ordered dictionaries. Use this for
21- complex, non-string, empty, or case-colliding mapping keys.
22-
23- . PARAMETER NoEnumerate
24- Writes each top-level YAML sequence as one array pipeline record.
25-
26- . PARAMETER Depth
27- Maximum YAML node nesting depth. The default is 100.
28-
29- . PARAMETER MaxNodes
30- Maximum number of YAML nodes in the stream. The default is 100000.
31-
32- . PARAMETER MaxAliases
33- Maximum number of alias nodes in the stream. The default is 1000.
34-
35- . PARAMETER MaxScalarLength
36- Maximum decoded character count for one scalar. The default is
37- 1048576.
38-
39- . PARAMETER MaxTagLength
40- Maximum expanded character count for one tag. The default is 1024.
41-
42- . PARAMETER MaxTotalTagLength
43- Maximum cumulative expanded tag characters. The default is 65536.
44-
45- . PARAMETER MaxNumericLength
46- Maximum digits in an implicitly or explicitly typed number. The
47- default is 4096.
48-
4915 . EXAMPLE
5016 'name: Ada' | ConvertFrom-Yaml
5117
@@ -59,41 +25,67 @@ function ConvertFrom-Yaml {
5925 . INPUTS
6026 System.String[]
6127
28+ The YAML text to parse. Multiple pipeline records are joined with a line feed.
29+
6230 . OUTPUTS
6331 System.Object
6432
33+ The PowerShell value constructed from each YAML document in the stream.
34+
6535 . LINK
66- https://github.com/PSModule/ Yaml#parse-yaml
36+ https://psmodule.io/ Yaml/Functions/ConvertFrom-Yaml/
6737 #>
6838 [CmdletBinding ()]
6939 [OutputType ([object ])]
7040 param (
41+ # The YAML text to parse. Multiple pipeline records are joined with a
42+ # line feed and parsed as a single stream, which supports Get-Content.
7143 [Parameter (Mandatory , Position = 0 , ValueFromPipeline )]
7244 [AllowEmptyString ()]
7345 [string []] $Yaml ,
7446
47+ # Return mappings as insertion-ordered dictionaries so complex, non-string,
48+ # empty, or case-colliding keys survive intact.
49+ [Parameter ()]
7550 [switch ] $AsHashtable ,
7651
52+ # Write each top-level sequence as a single array record instead of
53+ # enumerating its items onto the pipeline.
54+ [Parameter ()]
7755 [switch ] $NoEnumerate ,
7856
57+ # Cap YAML node nesting depth so hostile input can't exhaust the stack.
58+ [Parameter ()]
7959 [ValidateRange (1 , 128 )]
8060 [int ] $Depth = 100 ,
8161
62+ # Cap the total node count to bound memory for a single stream.
63+ [Parameter ()]
8264 [ValidateRange (1 , 2147483647 )]
8365 [int ] $MaxNodes = 100000 ,
8466
67+ # Cap alias nodes to prevent alias-expansion amplification.
68+ [Parameter ()]
8569 [ValidateRange (0 , 2147483647 )]
8670 [int ] $MaxAliases = 1000 ,
8771
72+ # Cap decoded characters per scalar to bound per-node memory.
73+ [Parameter ()]
8874 [ValidateRange (1 , 2147483647 )]
8975 [int ] $MaxScalarLength = 1048576 ,
9076
77+ # Cap expanded characters for a single tag.
78+ [Parameter ()]
9179 [ValidateRange (1 , 1048576 )]
9280 [int ] $MaxTagLength = 1024 ,
9381
82+ # Cap cumulative expanded tag characters across the stream.
83+ [Parameter ()]
9484 [ValidateRange (1 , 2147483647 )]
9585 [int ] $MaxTotalTagLength = 65536 ,
9686
87+ # Cap the digit count of an implicitly or explicitly typed number.
88+ [Parameter ()]
9789 [ValidateRange (1 , 1048576 )]
9890 [int ] $MaxNumericLength = 4096
9991 )
0 commit comments