external help file | Module Name | online version | schema |
---|---|---|---|
PSToml.dll-Help.xml |
PSToml |
2.0.0 |
Converts a TOML-formatted string to a dictionary.
ConvertFrom-Toml [-InputObject] <String[]> [<CommonParameters>]
The ConvertFrom-Toml
cmdlet converts a Tom's Obvious Minimal Language (TOML) formatted string to a Dictionary
object that hs a key for field in the TOML string.
To generate a TOML string from any object, use the ConvertTo-Toml cmdlet.
PS C:\> $obj = ConvertFrom-Toml -InputObject @'
foo = "bar"
'@
PS C:\> $obj.foo # bar
Converts the TOML string to a Dictionary object. The TOML keys can be accessed in the dictionary like any other dictionary object in PowerShell.
PS C:\> Get-Content pyproject.toml | ConvertFrom-Toml
Reads the contents of the file pyproject.toml
and converts it from the TOML string to an object.
The TOML string to convert.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
All the string inputs will be combined together as a single string to convert from a TOML string.
This cmdlet returns an OrderedDictionary
for each input TOML string provided. The underlying TOML table/dicts will also be an OrderedDictionary
and a TOML list will be an Object[]
.
This cmdlet uses the dotnet assembly Tomlyn to perform the TOML conversions.