Format-List

Format output as a list of object properties, each on a new line.

Syntax
       Format-List [[-Property] Object[]]  [-view string]
          [-groupBy Object] [-force] [-inputObject psobject]
             [-expand string]  [-displayError]
                [-showError] [CommonParameters]
key
   -Property Object[]
       The object properties to display (in order)
       Wildcards are permitted.
       You cannot use -Property and -View in the same command.

   -view string
       The name of an alternate format or "view." 
       You cannot use -Property and -View in the same command.

   -groupBy Object
       Format the output in groups based on a shared property or value.

   -force 
       Override restrictions that prevent the command from succeeding, 
       without compromising security. Force will override read-only
       attributes but will not change file permissions.

   -inputObject psobject
       The objects to format.
       A variable, command or expression that gets the objects.

   -expand string
       Where string is either "EnumOnly" (the default), "CoreOnly" or "Both"
       "CoreOnly" will format and display properties of the collection object itself, 
       while 'emumOnly' will enumerate and display the object properties. 
       (designed around the ICollection (System.Collections) interface.)

   -displayError 
       Display errors at the command line.

   -showError 
       Send errors through the pipeline.CommonParameters
       The common parameters: -Verbose, -Debug,-ErrorAction, -ErrorVariable, -OutVariable.

   CommonParameters:
       -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable,
       -OutBuffer -OutVariable.

Standard Aliases for Format-List: fl

Format-Custom The value of -GroupBy or -Property can be a new calculated property. To create a calculated property, use a hash table. Valid keys are:

Name (or Label) string
Expression string or script block
FormatString string

Custom display formats can also be defined using XML tags see get-help about_Display.xml for details.

Examples

Print a list of running processes, incuding the process name and path:

PS C:\>get-process | format-list -property name, path

Print a list of running processes, incuding all the properties:

PS C:\>get-process | format-list -property *

Print the objects stored in $My_Variable in list format:

PS C:\>format-list -InputObject $My_Variable

“Knowledge is a process of piling up facts; wisdom lies in their simplification” ~ Martin Fischer

Related:

format-custom - Format output using a customized view
format-table - Format the output as a table
format-wide - Format objects as a table of their properties
out-file - Send command output to a file
out-host - Send the pipelined output to the host


© Copyright SS64.com 1999-2014
Some rights reserved