en-US/PSIniToolbox-Help.xml

<?xml version="1.0" encoding="utf-8"?>
<helpItems 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" schema="maml" xmlns="http://msh">
  <command:command>
    <command:details>
      <command:name>ConvertFrom-Ini</command:name>
      <maml:description>
        <maml:para>Parses INI-formatted text into an IniDocument.</maml:para>
      </maml:description>
      <command:verb>ConvertFrom</command:verb>
      <command:noun>Ini</command:noun>
    </command:details>
    <maml:description>
      <maml:para>Accepts INI content from the pipeline and returns an IniDocument.
Both forms of
Get-Content work: an array of lines (Get-Content ./app.ini) or a single multi-line
string (Get-Content ./app.ini -Raw).</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>ConvertFrom-Ini</maml:name>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="none">
          <maml:name>InlineCommentMode</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">IniInlineCommentMode</command:parameterValue>
          <dev:type>
            <maml:name>IniInlineCommentMode</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none">
          <maml:name>InputObject</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">string[]</command:parameterValue>
          <dev:type>
            <maml:name>System.String[]</maml:name>
          </dev:type>
        </command:parameter>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="none">
        <maml:name>InlineCommentMode</maml:name>
        <maml:description>
          <maml:para>Whether to split trailing inline comments from values (None, First, or Last).
Default None.</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">IniInlineCommentMode</command:parameterValue>
        <dev:type>
          <maml:name>IniInlineCommentMode</maml:name>
        </dev:type>
      </command:parameter>
      <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue)" position="Named" aliases="none">
        <maml:name>InputObject</maml:name>
        <maml:description>
          <maml:para>INI text, bound from the pipeline as either lines or a single string.</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">System.String[]</command:parameterValue>
        <dev:type>
          <maml:name>System.String[]</maml:name>
        </dev:type>
      </command:parameter>
    </command:parameters>
    <command:inputTypes>
      <command:inputType>
        <dev:type>
          <maml:name>System.String[]</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>INI text piped in as an array of lines or a single raw multi-line string.</maml:para>
        </maml:description>
      </command:inputType>
    </command:inputTypes>
    <command:returnValues>
      <command:returnValue>
        <dev:type>
          <maml:name>IniDocument</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>The parsed document</maml:para>
        </maml:description>
      </command:returnValue>
    </command:returnValues>
    <maml:alertSet>
      <maml:alert>
        <maml:para />
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>--------- EXAMPLE 1 ---------</maml:title>
        <maml:introduction>
          <maml:para>Get-Content ./app.ini -Raw | ConvertFrom-Ini</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
      <command:example>
        <maml:title>--------- EXAMPLE 2 ---------</maml:title>
        <maml:introduction>
          <maml:para>Get-Content ./app.ini | ConvertFrom-Ini</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>Online Version</maml:linkText>
        <maml:uri />
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
  <command:command>
    <command:details>
      <command:name>ConvertTo-Ini</command:name>
      <maml:description>
        <maml:para>Serializes an IniDocument to INI-formatted text.</maml:para>
      </maml:description>
      <command:verb>ConvertTo</command:verb>
      <command:noun>Ini</command:noun>
    </command:details>
    <maml:description>
      <maml:para>Returns the INI text for an IniDocument, applying its formatting options.
The
output ends with a trailing newline, matching what Save-IniContent writes.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>ConvertTo-Ini</maml:name>
        <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="none">
          <maml:name>Document</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">IniDocument</command:parameterValue>
          <dev:type>
            <maml:name>IniDocument</maml:name>
          </dev:type>
        </command:parameter>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters>
      <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue)" position="0" aliases="none">
        <maml:name>Document</maml:name>
        <maml:description>
          <maml:para>The IniDocument to serialize.
Accepts pipeline input.</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">IniDocument</command:parameterValue>
        <dev:type>
          <maml:name>IniDocument</maml:name>
        </dev:type>
      </command:parameter>
    </command:parameters>
    <command:inputTypes>
      <command:inputType>
        <dev:type>
          <maml:name>IniDocument</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>The document to serialize</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>The INI text for the document</maml:para>
        </maml:description>
      </command:returnValue>
    </command:returnValues>
    <maml:alertSet>
      <maml:alert>
        <maml:para />
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>--------- EXAMPLE 1 ---------</maml:title>
        <maml:introduction>
          <maml:para>$ini | ConvertTo-Ini</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
      <command:example>
        <maml:title>--------- EXAMPLE 2 ---------</maml:title>
        <maml:introduction>
          <maml:para>Get-Content ./app.ini -Raw | ConvertFrom-Ini | ConvertTo-Ini</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>Online Version</maml:linkText>
        <maml:uri />
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
  <command:command>
    <command:details>
      <command:name>Get-IniContent</command:name>
      <maml:description>
        <maml:para>Reads an INI file and returns an IniDocument that preserves comments and layout.</maml:para>
      </maml:description>
      <command:verb>Get</command:verb>
      <command:noun>IniContent</command:noun>
    </command:details>
    <maml:description>
      <maml:para>Parses an INI-formatted configuration file into an IniDocument object.
Sections,
key/value pairs, comments, and blank lines are retained so the document can be
modified and written back out with its original structure intact.
Repeated keys
within a section are collected into an array of values.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Get-IniContent</maml:name>
        <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="FilePath, FullName">
          <maml:name>Path</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">string</command:parameterValue>
          <dev:type>
            <maml:name>System.String</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="1" aliases="none">
          <maml:name>InlineCommentMode</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">IniInlineCommentMode</command:parameterValue>
          <dev:type>
            <maml:name>IniInlineCommentMode</maml:name>
          </dev:type>
        </command:parameter>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="1" aliases="none">
        <maml:name>InlineCommentMode</maml:name>
        <maml:description>
          <maml:para>Whether to split trailing inline comments from values (None, First, or Last).
Default None.</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">IniInlineCommentMode</command:parameterValue>
        <dev:type>
          <maml:name>IniInlineCommentMode</maml:name>
        </dev:type>
      </command:parameter>
      <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="0" aliases="FilePath, FullName">
        <maml:name>Path</maml:name>
        <maml:description>
          <maml:para>Path to the INI file to read.</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">System.String</command:parameterValue>
        <dev:type>
          <maml:name>System.String</maml:name>
        </dev:type>
      </command:parameter>
    </command:parameters>
    <command:inputTypes>
      <command:inputType>
        <dev:type>
          <maml:name>System.String</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>A path to an INI file</maml:para>
        </maml:description>
      </command:inputType>
    </command:inputTypes>
    <command:returnValues>
      <command:returnValue>
        <dev:type>
          <maml:name>IniDocument</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>The parsed document</maml:para>
        </maml:description>
      </command:returnValue>
    </command:returnValues>
    <maml:alertSet>
      <maml:alert>
        <maml:para />
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>--------- EXAMPLE 1 ---------</maml:title>
        <maml:introduction>
          <maml:para>$ini = Get-IniContent -Path ./app.ini
$ini.Set('database', 'host', 'localhost')
Save-IniContent -Document $ini -Path ./app.ini</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>Online Version</maml:linkText>
        <maml:uri />
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
  <command:command>
    <command:details>
      <command:name>New-IniDocument</command:name>
      <maml:description>
        <maml:para>Creates a new, empty IniDocument.</maml:para>
      </maml:description>
      <command:verb>New</command:verb>
      <command:noun>IniDocument</command:noun>
    </command:details>
    <maml:description>
      <maml:para>Returns a fresh IniDocument that can be populated with the Add/Set methods and
written to disk with Save-IniContent.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>New-IniDocument</maml:name>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters />
    <command:inputTypes>
      <command:inputType>
        <dev:type>
          <maml:name>None. This command does not accept pipeline input.</maml:name>
        </dev:type>
        <maml:description>
          <maml:para />
        </maml:description>
      </command:inputType>
    </command:inputTypes>
    <command:returnValues>
      <command:returnValue>
        <dev:type>
          <maml:name>IniDocument</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>A new</maml:para>
        </maml:description>
      </command:returnValue>
    </command:returnValues>
    <maml:alertSet>
      <maml:alert>
        <maml:para />
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>--------- EXAMPLE 1 ---------</maml:title>
        <maml:introduction>
          <maml:para>$ini = New-IniDocument
$ini.Set('server', 'port', '8080')
Save-IniContent -Document $ini -Path ./app.ini</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>Online Version</maml:linkText>
        <maml:uri />
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
  <command:command>
    <command:details>
      <command:name>Save-IniContent</command:name>
      <maml:description>
        <maml:para>Writes an IniDocument to a file.</maml:para>
      </maml:description>
      <command:verb>Save</command:verb>
      <command:noun>IniContent</command:noun>
    </command:details>
    <maml:description>
      <maml:para>Serializes an IniDocument back to INI format, preserving comments, blank lines,
and the detected spacing style, then writes it to the specified path.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Save-IniContent</maml:name>
        <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0" aliases="none">
          <maml:name>Document</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">IniDocument</command:parameterValue>
          <dev:type>
            <maml:name>IniDocument</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="1" aliases="FilePath">
          <maml:name>Path</maml:name>
          <maml:description />
          <command:parameterValue required="true" variableLength="false">string</command:parameterValue>
          <dev:type>
            <maml:name>System.String</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none">
          <maml:name>WhatIf</maml:name>
          <maml:description />
          <dev:type>
            <maml:name>System.Management.Automation.SwitchParameter</maml:name>
          </dev:type>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="none">
          <maml:name>Confirm</maml:name>
          <maml:description />
          <dev:type>
            <maml:name>System.Management.Automation.SwitchParameter</maml:name>
          </dev:type>
        </command:parameter>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="cf">
        <maml:name>Confirm</maml:name>
        <maml:description>
          <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para>
        </maml:description>
        <dev:type>
          <maml:name>System.Management.Automation.SwitchParameter</maml:name>
        </dev:type>
      </command:parameter>
      <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue)" position="0" aliases="none">
        <maml:name>Document</maml:name>
        <maml:description>
          <maml:para>The IniDocument to write.</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">IniDocument</command:parameterValue>
        <dev:type>
          <maml:name>IniDocument</maml:name>
        </dev:type>
      </command:parameter>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="1" aliases="FilePath">
        <maml:name>Path</maml:name>
        <maml:description>
          <maml:para>Destination path for the INI file.
Defaults to the path the document was loaded
from (or last saved to).</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="true">System.String</command:parameterValue>
        <dev:type>
          <maml:name>System.String</maml:name>
        </dev:type>
      </command:parameter>
      <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="Named" aliases="wi">
        <maml:name>WhatIf</maml:name>
        <maml:description>
          <maml:para>Runs the command in a mode that only reports what would happen without performing the actions.</maml:para>
        </maml:description>
        <dev:type>
          <maml:name>System.Management.Automation.SwitchParameter</maml:name>
        </dev:type>
      </command:parameter>
    </command:parameters>
    <command:inputTypes>
      <command:inputType>
        <dev:type>
          <maml:name>IniDocument</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>The document to write</maml:para>
        </maml:description>
      </command:inputType>
    </command:inputTypes>
    <command:returnValues>
      <command:returnValue>
        <dev:type>
          <maml:name>None. This command writes the document to disk and returns nothing.</maml:name>
        </dev:type>
        <maml:description>
          <maml:para />
        </maml:description>
      </command:returnValue>
    </command:returnValues>
    <maml:alertSet>
      <maml:alert>
        <maml:para />
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>--------- EXAMPLE 1 ---------</maml:title>
        <maml:introduction>
          <maml:para>Save-IniContent -Document $ini -Path ./app.ini</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
      <command:example>
        <maml:title>--------- EXAMPLE 2 ---------</maml:title>
        <maml:introduction>
          <maml:para>$ini | Save-IniContent -Path ./app.ini</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
      <command:example>
        <maml:title>--------- EXAMPLE 3 ---------</maml:title>
        <maml:introduction>
          <maml:para>Get-IniContent ./app.ini | Save-IniContent # writes back to ./app.ini</maml:para>
        </maml:introduction>
        <dev:code />
        <dev:remarks />
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>Online Version</maml:linkText>
        <maml:uri />
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
</helpItems>