Cmdlet
Export-OfficeToml
Writes PowerShell objects to a TOML file; the file form of ConvertTo-OfficeToml.
Syntax
Export-OfficeToml
[-Depth <Int32>]
-InputObject <Object>
[-NoClobber]
[-PassThru]
[-Path] <String>
[-RootName <String>]
[<CommonParameters>]#Parameter set:
InputObjectDescription
The file is UTF-8 without a byte-order mark and is written atomically. An existing file is replaced unless NoClobber is set. Nested objects become [table] sections and lists of objects [[array]] sections; nulls are omitted with a warning.
Examples
Save settings to a file.
[ordered]@{ title = 'Report'; owner = [ordered]@{ name = 'Ops'; updated = Get-Date } } | Export-OfficeToml -Path ./settings.tomlExport an inventory without replacing an existing file.
Import-OfficeCsv -Path ./servers.csv | Export-OfficeToml -Path ./inventory.toml -RootName server -NoClobber -PassThruParameters
- -Depth Int32
- How many levels of nested objects to write; deeper values become their string form.
- -InputObject Object
- Objects to write; an argument is written exactly as given, piped objects as one value or an array.
- -NoClobber SwitchParameter
- Refuse to replace an existing file.
- -PassThru SwitchParameter
- Return the written file.
- -Path String
- The TOML file to create.
- -RootName String
- The key that holds input which is not an object, because a TOML document is a 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.