en-US/PSToml.dll-Help.xml
<?xml version="1.0" encoding="utf-8"?> <helpItems schema="maml" xmlns="http://msh"> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>ConvertFrom-Toml</command:name> <command:verb>ConvertFrom</command:verb> <command:noun>Toml</command:noun> <maml:description> <maml:para>Converts a TOML-formatted string to a dictionary.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>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.</maml:para> <maml:para>To generate a TOML string from any object, use the ConvertTo-Toml (./ConvertTo-Toml.md)cmdlet.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>ConvertFrom-Toml</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>InputObject</maml:name> <maml:description> <maml:para>The TOML string to convert.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>InputObject</maml:name> <maml:description> <maml:para>The TOML string to convert.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String[]</maml:name> </dev:type> <maml:description> <maml:para>All the string inputs will be combined together as a single string to convert from a TOML string.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Collections.Specialized.OrderedDictionary</maml:name> </dev:type> <maml:description> <maml:para>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[]`.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>This cmdlet uses the dotnet assembly Tomlyn (https://github.com/xoofx/Tomlyn/tree/main)to perform the TOML conversions.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>---------- Example 1 - Convert TOML string to object ----------</maml:title> <dev:code>PS C:\> $obj = ConvertFrom-Toml -InputObject @' foo = "bar" '@ PS C:\> $obj.foo # bar</dev:code> <dev:remarks> <maml:para>Converts the TOML string to a Dictionary object. The TOML keys can be accessed in the dictionary like any other dictionary object in PowerShell.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 2 - Convert TOML from file to an object -------</maml:title> <dev:code>PS C:\> Get-Content pyproject.toml | ConvertFrom-Toml</dev:code> <dev:remarks> <maml:para>Reads the contents of the file `pyproject.toml` and converts it from the TOML string to an object.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://www.github.com/jborean93/PSToml/blob/main/docs/en-US/ConvertFrom-Toml.md</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>TOML</maml:linkText> <maml:uri>https://toml.io/en/</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>ConvertTo-Toml</command:name> <command:verb>ConvertTo</command:verb> <command:noun>Toml</command:noun> <maml:description> <maml:para>Converts an object to a TOML-formatted string.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `ConvertTo-Toml` cmdlet converts any dotnet object to a string in the Tom's Obvious Minimal Language (TOML) format. The ConvertFrom-Toml (./ConvertFrom-Toml.md)cmdlet can be used to convert a TOML string into a dictionary that can be managed in PowerShell.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>ConvertTo-Toml</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>InputObject</maml:name> <maml:description> <maml:para>The input object to convert to the TOML string. This can be either a dictionary like object or any class object where the properties are used as the TOML keys.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Object[]</command:parameterValue> <dev:type> <maml:name>Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Depth</maml:name> <maml:description> <maml:para>Specifies how many levels of contained objects are included in the TOML representation. The value can be any non-negative number with the default being `2`. `ConvertTo-Toml` emits a warning if the number of levels in an input object exceeds this number.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>2</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Depth</maml:name> <maml:description> <maml:para>Specifies how many levels of contained objects are included in the TOML representation. The value can be any non-negative number with the default being `2`. `ConvertTo-Toml` emits a warning if the number of levels in an input object exceeds this number.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>2</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>InputObject</maml:name> <maml:description> <maml:para>The input object to convert to the TOML string. This can be either a dictionary like object or any class object where the properties are used as the TOML keys.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Object[]</command:parameterValue> <dev:type> <maml:name>Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Object</maml:name> </dev:type> <maml:description> <maml:para>Any object piped into this cmdlet will be converted to a TOML string.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns a string representation of the input object converted to a TOML string.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>This cmdlet uses the dotnet assembly Tomlyn (https://github.com/xoofx/Tomlyn/tree/main)to perform the TOML conversions.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>------------ Example 1 - Convert dictionary to TOML ------------</maml:title> <dev:code>PS C:\> @{Foo = 'Bar'} | ConvertTo-Toml</dev:code> <dev:remarks> <maml:para>Converts the input hashtable into a TOML string.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------- Example 2 - Convert dotnet object to TOML ----------</maml:title> <dev:code>PS C:\> [PSCustomObject]@{Foo = 'Bar'} | ConvertTo-Toml</dev:code> <dev:remarks> <maml:para>Converts the input object into a TOML string. While this example uses a `PSCustomObject`, any dotnet object can be used as the input object.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://www.github.com/jborean93/PSToml/blob/main/docs/en-US/ConvertTo-Toml.md</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>TOML</maml:linkText> <maml:uri>https://toml.io/en/</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> </helpItems> |