Cmdlet
New-OfficeToml
Creates a live TOML document, or atomically publishes a completed content block.
Syntax
Description
Inside the block, Set-OfficeTomlNode and the other node commands edit the new document without -Document. Setting a key below a missing table adds the table's [header] section.
Examples
Write a project file in one block.
New-OfficeToml -Path ./pyproject.toml {
Set-OfficeTomlNode -Select 'project.name' -Value 'reporting'
Set-OfficeTomlNode -Select 'tool.ruff.line-length' -Value 100
}Compose a live document and save it later.
$document = New-OfficeToml
Set-OfficeTomlNode -Document $document -Select 'title' -Value 'Release notes'
Save-OfficeToml -Document $document -Path ./config.toml
Close-OfficeToml -Document $documentParameters
- -Force SwitchParameter
- Allow an existing destination; a failed block preserves its original contents.
- -Path String
- Optional associated destination for a live document; required when a content block saves a file.
- -AllowLoss SwitchParameter
- Explicitly accept reductions reported by the content block's native save.
- -Content ScriptBlock
- Authoring block to complete before the document is atomically saved and closed.
- -PassThru SwitchParameter
- Return the saved FileInfo after a completed content block.
- -Show SwitchParameter
- Open the saved result in its registered application after the content block succeeds.
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.