Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

A. PowerShell Language and Environment > Capturing Output - Pg. 760

Formatting command Format-List Properties Result Formats the properties of the input objects as a list, including only the object properties you specify. If you do not specify a property list, PowerShell picks a default set. The Format-List cmdlet supports the advanced formatting statements as used by the Format- Table cmdlet. The Format-List cmdlet is the one you will use most often to get a detailed summary of an object's properties. The command Format-List * returns all properties, but it does not include those that PowerShell hides by default. The command Format-List * -Force returns all properties. For more information about the Format-List cmdlet, type Get-Help Format-List . Format-Wide Property Formats the properties of the input objects in an extremely terse summary view. If you do not specify a property, PowerShell picks a default. In addition to supplying object properties, you can also provide advanced formatting statements: PS > Get-Process | ` Format-Wide -Auto ` @{ Expression={ "{0:x}" -f $_.Id} } The advanced formatting statement is a hashtable with the key Expression (or any short form of it). The value of the expression key should be a script block that returns a result for the current object (represented by the $_ variable). For more information about the Format-Wide cmdlet, type Get-Help Format-Wide .