Cmdlet
Import-OfficeToml
Reads TOML files as PowerShell objects; the file form of ConvertFrom-OfficeToml.
Syntax
Description
Output follows ConvertFrom-OfficeToml: tables become PSCustomObjects in file order, or ordered hashtables with AsHashtable. A file that fails to parse writes a non-terminating error with the engine's code, line and column, and the next file is read.
Examples
Read a tool's settings.
$ruff = (Import-OfficeToml -Path ./pyproject.toml).tool.ruff
$ruff.'line-length'Read the manifest of every crate under a folder.
Get-ChildItem ./crates -Filter Cargo.toml -Recurse | Import-OfficeToml | ForEach-Object { $_.package.name }Parameters
- -AsHashtable SwitchParameter
- Return tables as ordered hashtables instead of PSCustomObjects.
- -Depth Int32
- Deepest nesting of tables and arrays to accept; sets the reader's MaxDepth.
- -Path String[]
- TOML files with FileSystem wildcard expansion.
- -Untrusted SwitchParameter
- Caps every limit at the engine's untrusted defaults, for files from outside.
- -LiteralPath String[]
- Literal TOML files, including FileInfo.FullName and provider PSPath.
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.