Cmdlet
Remove-OfficeTomlNode
Removes keys, tables or array items from a live TOML document by path.
Syntax
Remove-OfficeTomlNode
[-Document <TomlDocument>]
[-Select] <String[]>
[<CommonParameters>]#Parameter set:
DocumentDescription
A key goes with its line and the comment lines directly above it; a table goes with all of its sections, wherever they are in the file. Neighboring keys and comments stay. A path with nothing at it writes a non-terminating ObjectNotFound error.
Examples
Drop a setting inside an editing block.
Open-OfficeToml -Path ./pyproject.toml {
Remove-OfficeTomlNode -Select 'tool.ruff.lint.ignore'
}Remove a table of an array of tables if it is there.
Remove-OfficeTomlNode -Document $document -Select 'bin[1]' -ErrorAction SilentlyContinueParameters
- -Document TomlDocument
- Gets or sets an explicit live document; omission uses the enclosing content block.
- -Select String[]
- Paths of the keys, tables or items to remove.
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.