Formatting the output in Windows Powershell

Powershell uses settings stored in XML file as shown in below image.



For example – to display the process output, it uses settings in DotNetTypes.format.ps1xml

But you can also format the way output looks like in Powershell using below commands.

  1. Format-Table : This command displays the output in table format. You can specify which columns you want to see using command like ” Get-Process | format-table -property name, starttime”. We can also group by specific property.
  2. Format-List : This command will display each property of the object on new line instead of tabular format.
  3. Format-Wide : Formats objects displays only single property of the object.
  4. Get-FormatData and Export-FormatData : These commands let you view and export format data in current session.
  5. Format-Custom : You can customize the output using this command.


You may also like...