SplitCollection.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>Split-Collection</command:name>
      <command:verb>Split</command:verb>
      <command:noun>Collection</command:noun>
      <maml:description>
        <maml:para>Splits collections into smaller collections.</maml:para>
      </maml:description>
    </command:details>
    <maml:description>
      <maml:para>This cmdlet splits collections (arrays, lists, etc.) into smaller arrays.
Collections can be split in 2 ways:</maml:para>
      <maml:para>ChunkSize (each sub array will have the user specified size.)
AmountOfParts (the input objects will be divided evenly between X amount of sub arrays.)</maml:para>
      <maml:para>The cmdlet generally doesn't throw errors, but it will write warnings if there aren't enough input objects for the specified sizes.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Split-Collection</maml:name>
        <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none">
          <maml:name>InputObject</maml:name>
          <maml:Description>
            <maml:para>The collection to split into smaller arrays.</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>ChunkSize</maml:name>
          <maml:Description>
            <maml:para>Specifies how big each sub array will be.</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>None</dev:defaultValue>
        </command:parameter>
      </command:syntaxItem>
      <command:syntaxItem>
        <maml:name>Split-Collection</maml:name>
        <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none">
          <maml:name>InputObject</maml:name>
          <maml:Description>
            <maml:para>The collection to split into smaller arrays.</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>AmountOfParts</maml:name>
          <maml:Description>
            <maml:para>Specifies how many sub arrays will be created. The input collection is divided evenly between each of the new arrays.</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>None</dev:defaultValue>
        </command:parameter>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters>
      <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none">
        <maml:name>InputObject</maml:name>
        <maml:Description>
          <maml:para>The collection to split into smaller arrays.</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>ChunkSize</maml:name>
        <maml:Description>
          <maml:para>Specifies how big each sub array will be.</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>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
        <maml:name>AmountOfParts</maml:name>
        <maml:Description>
          <maml:para>Specifies how many sub arrays will be created. The input collection is divided evenly between each of the new arrays.</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>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></maml:para>
        </maml:description>
      </command:inputType>
    </command:inputTypes>
    <command:returnValues>
      <command:returnValue>
        <dev:type>
          <maml:name>System.Object[]</maml:name>
        </dev:type>
        <maml:description>
          <maml:para></maml:para>
        </maml:description>
      </command:returnValue>
    </command:returnValues>
    <maml:alertSet>
      <maml:alert>
        <maml:para></maml:para>
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>---- Example 1 Splitting objects evenly for jobs to process ----</maml:title>
        <dev:code>PS C:\&gt; Split-Collection -InputObject (Get-Content -Path C:\FolderList.txt) -AmountOfParts 4 | ForEach {Start-Job -ScriptBlock {Invoke-Scan $using:_}}</dev:code>
        <dev:remarks>
          <maml:para>This example divides the paths specified in C:\FolderList.txt evenly into 4 chunks. Each chunk is then used to start a job that processes these paths.</maml:para>
        </dev:remarks>
      </command:example>
    </command:examples>
    <command:relatedLinks />
  </command:command>
</helpItems>