ShowColumns.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>Show-Columns</command:name>
      <command:verb>Show</command:verb>
      <command:noun>Columns</command:noun>
      <maml:description>
        <maml:para>Displays one property of input objects in autosized columns with optional grouping and styling based on object properties.</maml:para>
      </maml:description>
    </command:details>
    <maml:description>
      <maml:para>This cmdlet displays input items in columns with optional grouping and styling based on object properties. Each item is displayed as single string which can be either value of any input object property or can be calculated dynamically for each object by user-defined expression.</maml:para>
      <maml:para>Column widths are calculated based on lengths of displayed labels. Number of columns is calculated so that as much items as possible fit on screen. `MinimumColumnCount` parameter can be specified to limit the number of columns even if some items are longer than available width for given column count. Not fitting items will have ellipsis added.</maml:para>
      <maml:para>Items can be grouped by using `GroupBy` parameter. This command assumes that input is already correctly sorted by this value. If the items are not sorted you can either call `Sort-Object` before passing them to this cmdlet or display them as is but then some group headers will be displayed several times which can be desired or not depending on circumstances.</maml:para>
      <maml:para>Colors and text decoration can be specified both for group headers using `GroupHeaderStyle` parameter as well as for individual items using `ItemStyle` parameter.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Show-Columns</maml:name>
        <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none">
          <maml:name>Property</maml:name>
          <maml:description>
            <maml:para>Specifies property or dynamically calculated value that will be used as object labels. If this parameter is omitted then `ToString()` is called on each input item to get label.</maml:para>
            <maml:para>It can be:</maml:para>
            <maml:para>* Property name `[String]` - Value of given property is displayed. Example: `Show-Columns -Property 'Name'`.</maml:para>
            <maml:para>* Expression `[ScriptBlock]` - Value returned from given script block is displayed. Input object can be accessed inside script block by using `$_` automatic variable. If returned value is not of type `String` then `ToString()` method is called on it to get actual label.</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="1" aliases="none">
          <maml:name>GroupBy</maml:name>
          <maml:description>
            <maml:para>If specified then input objects are grouped based on the value of this property. This command assumes that input is already correctly sorted by this value.</maml:para>
            <maml:para>It can be:</maml:para>
            <maml:para>* Property name `[String]` - Objects are grouped by property with given name. Example: `Show-Columns -GroupBy 'GroupName'`.</maml:para>
            <maml:para>* Expression `[ScriptBlock]` - Objects are grouped by value returned from given script block. Input object can be accessed inside script block by using `$ ` automatic variable. Returned value can be of any type not only `string`. Example: `Show-Columns -GroupBy { Convert-Path $ .PSParentPath }`.</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>GroupHeaderStyle</maml:name>
          <maml:description>
            <maml:para>Defines text color and decoration for group headers.</maml:para>
            <maml:para>It can be:</maml:para>
            <maml:para>* Console color name `[String]` - foreground is set to given color. Example: `Show-Columns -GroupHeaderStyle 'Yellow'`.</maml:para>
            <maml:para>* Console color `[ConsoleColor]` - foreground is set to given `ConsoleColor`. Example: `Show-Columns -GroupHeaderStyle ([ConsoleColor]::Yellow)`.</maml:para>
            <maml:para>* Text style `[Hashtable]` - text style is defined by `Foreground`, `Background` and `Underline` keys in given hashtable. Example: `Show-Columns -GroupHeaderStyle @{ Foreground = 'Red'; Background = 'Gray'; Underline = $true }`.</maml:para>
            <maml:para>* Script block `[ScriptBlock]` - expression that received input object as `$ ` automatic variable and returns one of above values to set item style. Example: `Show-Columns -GroupHeaderStyle { if ($ .GroupName.Length -gt 10) { 'Red' } else { 'Blue' } }`.</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="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none">
          <maml:name>InputObject</maml:name>
          <maml:description>
            <maml:para>Input object that should be displayed.</maml:para>
          </maml:description>
          <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
          <dev:type>
            <maml:name>PSObject</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>ItemStyle</maml:name>
          <maml:description>
            <maml:para>Defines text color and decoration for displayed items.</maml:para>
            <maml:para>It can be:</maml:para>
            <maml:para>* Console color name `[String]` - foreground is set to given color. Example: `Show-Columns -ItemStyle 'Yellow'`.</maml:para>
            <maml:para>* Console color `[ConsoleColor]` - foreground is set to given `ConsoleColor`. Example: `Show-Columns -ItemStyle ([ConsoleColor]::Yellow)`.</maml:para>
            <maml:para>* Text style `[Hashtable]` - text style is defined by `Foreground`, `Background` and `Underline` keys in given hashtable. Example: `Show-Columns -ItemStyle @{ Foreground = 'Red'; Background = 'Gray'; Underline = $true }`.</maml:para>
            <maml:para>* Script block `[ScriptBlock]` - expression that receives input object as `$ ` automatic variable and returns one of above values to set item style. Example: `Show-Columns -ItemStyle { if ($ .PSIsContainer) { 'Blue' } else { 'Gray' } }`.</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>MinimumColumnCount</maml:name>
          <maml:description>
            <maml:para>Defines minimum number of columns that will be displayed even if some items are longer than available column width. Labels longer than column width will have ellipsis added.</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="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
        <maml:name>GroupBy</maml:name>
        <maml:description>
          <maml:para>If specified then input objects are grouped based on the value of this property. This command assumes that input is already correctly sorted by this value.</maml:para>
          <maml:para>It can be:</maml:para>
          <maml:para>* Property name `[String]` - Objects are grouped by property with given name. Example: `Show-Columns -GroupBy 'GroupName'`.</maml:para>
          <maml:para>* Expression `[ScriptBlock]` - Objects are grouped by value returned from given script block. Input object can be accessed inside script block by using `$ ` automatic variable. Returned value can be of any type not only `string`. Example: `Show-Columns -GroupBy { Convert-Path $ .PSParentPath }`.</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>GroupHeaderStyle</maml:name>
        <maml:description>
          <maml:para>Defines text color and decoration for group headers.</maml:para>
          <maml:para>It can be:</maml:para>
          <maml:para>* Console color name `[String]` - foreground is set to given color. Example: `Show-Columns -GroupHeaderStyle 'Yellow'`.</maml:para>
          <maml:para>* Console color `[ConsoleColor]` - foreground is set to given `ConsoleColor`. Example: `Show-Columns -GroupHeaderStyle ([ConsoleColor]::Yellow)`.</maml:para>
          <maml:para>* Text style `[Hashtable]` - text style is defined by `Foreground`, `Background` and `Underline` keys in given hashtable. Example: `Show-Columns -GroupHeaderStyle @{ Foreground = 'Red'; Background = 'Gray'; Underline = $true }`.</maml:para>
          <maml:para>* Script block `[ScriptBlock]` - expression that received input object as `$ ` automatic variable and returns one of above values to set item style. Example: `Show-Columns -GroupHeaderStyle { if ($ .GroupName.Length -gt 10) { 'Red' } else { 'Blue' } }`.</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="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none">
        <maml:name>InputObject</maml:name>
        <maml:description>
          <maml:para>Input object that should be displayed.</maml:para>
        </maml:description>
        <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue>
        <dev:type>
          <maml:name>PSObject</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>ItemStyle</maml:name>
        <maml:description>
          <maml:para>Defines text color and decoration for displayed items.</maml:para>
          <maml:para>It can be:</maml:para>
          <maml:para>* Console color name `[String]` - foreground is set to given color. Example: `Show-Columns -ItemStyle 'Yellow'`.</maml:para>
          <maml:para>* Console color `[ConsoleColor]` - foreground is set to given `ConsoleColor`. Example: `Show-Columns -ItemStyle ([ConsoleColor]::Yellow)`.</maml:para>
          <maml:para>* Text style `[Hashtable]` - text style is defined by `Foreground`, `Background` and `Underline` keys in given hashtable. Example: `Show-Columns -ItemStyle @{ Foreground = 'Red'; Background = 'Gray'; Underline = $true }`.</maml:para>
          <maml:para>* Script block `[ScriptBlock]` - expression that receives input object as `$ ` automatic variable and returns one of above values to set item style. Example: `Show-Columns -ItemStyle { if ($ .PSIsContainer) { 'Blue' } else { 'Gray' } }`.</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>MinimumColumnCount</maml:name>
        <maml:description>
          <maml:para>Defines minimum number of columns that will be displayed even if some items are longer than available column width. Labels longer than column width will have ellipsis added.</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="0" aliases="none">
        <maml:name>Property</maml:name>
        <maml:description>
          <maml:para>Specifies property or dynamically calculated value that will be used as object labels. If this parameter is omitted then `ToString()` is called on each input item to get label.</maml:para>
          <maml:para>It can be:</maml:para>
          <maml:para>* Property name `[String]` - Value of given property is displayed. Example: `Show-Columns -Property 'Name'`.</maml:para>
          <maml:para>* Expression `[ScriptBlock]` - Value returned from given script block is displayed. Input object can be accessed inside script block by using `$_` automatic variable. If returned value is not of type `String` then `ToString()` method is called on it to get actual label.</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.Management.Automation.PSObject</maml:name>
        </dev:type>
        <maml:description>
          <maml:para>You can pipe any object into this command.</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>This cmdlet returns no output.</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 --------------------------</maml:title>
        <dev:code>PS C:\Example&gt; Get-ChildItem . | Show-Columns -Property Name
 
file01.txt file03.txt file05.txt file07.txt file09.txt file11.txt file13.txt file15.txt file17.txt file19.txt
file02.txt file04.txt file06.txt file08.txt file10.txt file12.txt file14.txt file16.txt file18.txt file20.txt</dev:code>
        <dev:remarks>
          <maml:para></maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- Example 2 --------------------------</maml:title>
        <dev:code>PS C:\Example&gt; Get-Verb | Show-Columns -Property Verb -GroupBy Group
 
Common
Add Copy Find Hide Move Optimize Redo Reset Select Skip Switch Watch
Clear Enter Format Join New Push Remove Resize Set Split Undo
Close Exit Get Lock Open Pop Rename Search Show Step Unlock
 
Communications
Connect Disconnect Read Receive Send Write
 
Data
Backup Compress ConvertTo Expand Import Merge Publish Sync
Checkpoint Convert Dismount Export Initialize Mount Restore Unpublish
Compare ConvertFrom Edit Group Limit Out Save Update
 
Diagnostic
Debug Measure Ping Repair Resolve Test Trace
 
Lifecycle
Approve Build Confirm Deploy Enable Invoke Request Resume Stop Suspend Unregister
Assert Complete Deny Disable Install Register Restart Start Submit Uninstall Wait
 
Other
Use
 
Security
Block Grant Protect Revoke Unblock Unprotect</dev:code>
        <dev:remarks>
          <maml:para></maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- Example 3 --------------------------</maml:title>
        <dev:code>PS C:\Example&gt; Get-ChildItem | Show-Columns -Property Name -GroupBy { "Group: " + $_.Name.Substring(0,5) }
 
Group: file0
file01.txt file02.txt file03.txt file04.txt file05.txt file06.txt file07.txt file08.txt file09.txt
 
Group: file1
file10.txt file11.txt file12.txt file13.txt file14.txt file15.txt file16.txt file17.txt file18.txt file19.txt
 
Group: file2
file20.txt</dev:code>
        <dev:remarks>
          <maml:para></maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- Example 4 --------------------------</maml:title>
        <dev:code>PS C:\Example&gt; Get-ChildItem `
    | Show-Columns `
        -Property Name `
        -GroupBy { "Group: " + $_.Name.Substring(0,5) } `
        -ItemStyle { if ($_.Extension -eq '.md') { 'Blue' } else { 'Gray' } } `
        -GroupHeaderStyle @{ Foreground = 'Yellow'; Underline = $true }
 
Group: file0
file01.txt file02.txt file03.txt file04.txt file05.txt file06.txt file07.txt file08.txt file09.txt
 
Group: file1
file10.txt file11.txt file12.txt file13.txt file14.txt file15.txt file16.txt file17.txt file18.txt file19.txt
 
Group: file2
file20.txt</dev:code>
        <dev:remarks>
          <maml:para></maml:para>
        </dev:remarks>
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>Online Version:</maml:linkText>
        <maml:uri>https://github.com/lpatalas/ShowColumns/blob/master/docs/Show-Columns.md</maml:uri>
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
</helpItems>