Format-Table
Show objects as a table
Get-ChildItem | Format-Table Name, Length -AutoSize
- Works on
- WindowsLinuxmacOS
- PowerShell
- 5.1 and later
- Reference
- Microsoft Learn: Format-Table
Careful: Format-* cmdlets are for display. Do not pipe them into Export-Csv or more processing.
Formats output for your eyes. After Format-Table, the pipeline is format objects, not the original data. Filter and select first, format last.
Try this
Get-Process | Select-Object -First 8 Name, Id, CPU | Format-Table -AutoSize