Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Save-OfficeToml

Module
PSWriteOffice
Inputs
OfficeIMO.Toml.TomlDocument
Outputs
System.IO.FileInfo

Saves a live TOML document and keeps it available.

Syntax

Save-OfficeToml
-Document <TomlDocument>
[-PassThru]
[[-Path] <String>]
[<CommonParameters>]
#
Parameter set: Document

Description

The save is minimal-change: untouched text is copied from the source, with its line endings and UTF-8 byte-order mark, and only edited keys, values and comments are written anew in the layout of their neighbors.

Examples

Save to the file the document was opened from.

Save-OfficeToml -Document $document

Save to a new file, which the document then saves to, and return it.

Save-OfficeToml -Document $document -Path ./out/pyproject.toml -PassThru

Parameters

-Document TomlDocument requiredpipeline: True (ByValue)
TOML document to save.
-PassThru SwitchParameter optional
Return the saved file.
-Path String optionalposition: 0
Optional destination, which becomes the document's FilePath; omission saves to its FilePath.

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.