en-US/Format-XML-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>Format-XML</command:name>
      <command:verb>Format</command:verb>
      <command:noun>XML</command:noun>
      <maml:description>
        <maml:para>Accepts a string containing valid XML tags or an XMLElement object and outputs it as a formatted string including newline and indentation of child nodes.</maml:para>
      </maml:description>
    </command:details>
    <maml:description>
      <maml:para>Valid XML returned by the NSX API is a single string with no newlines or indentation. While PowerNSX cmdlets typicallly emit an XMLElement object, which PowerShell outputs as formatted tables or lists when outputing to host, making normal human interaction easy, for output to file or debug stream, format-xml converts the API returned XML to more easily read formated XML complete with linebreaks and indentation.</maml:para>
      <maml:para>As a side effect, this has the added benefit of being useable as an additional format handler on the PowerShell pipeline, so rather than displaying output objects using familiar table and list output formats, the user now has the option of displaying the native XML in a human readable format.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Format-XML</maml:name>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="2" aliases="none">
          <maml:name>xml</maml:name>
          <maml:Description>
            <maml:para>String object containing valid XML, or XMLElement or XMLDocument object</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>indent</maml:name>
          <maml:Description>
            <maml:para>Number of whitespace charaters to indent child nodes by when formatting</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="True (ByValue)" position="2" aliases="none">
        <maml:name>xml</maml:name>
        <maml:Description>
          <maml:para>String object containing valid XML, or XMLElement or XMLDocument object</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>indent</maml:name>
        <maml:Description>
          <maml:para>Number of whitespace charaters to indent child nodes by when formatting</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:parameters>
    <command:inputTypes />
    <command:returnValues />
    <maml:alertSet>
      <maml:alert>
        <maml:para></maml:para>
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
        <dev:code>Get-NsxTransportZone | Format-Xml</dev:code>
        <dev:remarks>
          <maml:para>Displays the XMLElement object returned by Get-NsxTransportZone as formatted XML.</maml:para>
        </dev:remarks>
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>Online Version:</maml:linkText>
        <maml:uri>https://mycloudrevolution.com/</maml:uri>
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
</helpItems>