Get-OfficeYamlNode
Gets nodes of a live YAML document by path, as Path, Value, Node, Line and Column objects.
Syntax
Get-OfficeYamlNode
[-AsHashtable]
[-Document <YamlDocument>]
[[-Select] <String[]>]
[<CommonParameters>]#DocumentDescription
Select uses the engine's path grammar: dotted keys, [n] for 0-based sequence items, ["key.with.dots"] for keys that are not plain names, and a leading $[n] for the 0-based document in a multi-document stream. Value holds plain PowerShell data as ConvertFrom-OfficeYaml returns it; Node is the live node. Line and Column are 1-based. Without Select, each document's root is returned.
Examples
Read one value.
(Get-OfficeYamlNode -Document $document -Select 'spec.template.spec.containers[0].image').ValueFind where settings live in the file.
Get-OfficeYamlNode -Document $document -Select 'spec.replicas', 'metadata.labels["app.kubernetes.io/name"]' |
Select-Object -Property Path, Value, Line, ColumnParameters
- -AsHashtable SwitchParameter
- Return mappings in Value as ordered hashtables instead of PSCustomObjects.
- -Document YamlDocument
- Gets or sets an explicit live document; omission uses the enclosing content block.
- -Select String[]
- Paths of the nodes to get; omission returns each document's root.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.