Get-OfficeTomlNode
Gets nodes of a live TOML document by path, as Path, Value, Node, Line and Column objects.
Syntax
Get-OfficeTomlNode
[-AsHashtable]
[-Document <TomlDocument>]
[[-Select] <String[]>]
[<CommonParameters>]#DocumentDescription
Select uses the engine's path grammar, the one YAML node paths use: dotted keys, [n] for 0-based array items and tables of an array of tables, and ["key.with.dots"] for keys that are not plain names. Value holds plain PowerShell data as ConvertFrom-OfficeToml returns it; Node is the live node. Line and Column are 1-based and point at the value or the [ of a header; tables made by dotted keys and nodes added by editing report 0. Without Select, the root table is returned.
Examples
Read one value.
(Get-OfficeTomlNode -Document $document -Select 'tool.ruff.line-length').ValueFind where settings live in the file.
Get-OfficeTomlNode -Document $document -Select 'project.version', 'tool.uv.sources["my.pkg"]' |
Select-Object -Property Path, Value, Line, ColumnParameters
- -AsHashtable SwitchParameter
- Return tables in Value as ordered hashtables instead of PSCustomObjects.
- -Document TomlDocument
- Gets or sets an explicit live document; omission uses the enclosing content block.
- -Select String[]
- Paths of the nodes to get; omission returns the root table.
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.