Format-Table in a powerful command that you can use to format your output. Output can be a console or a file out. Format-Table works with object or an object collection.
For example, if you have an object collection from your code, you can output as a table.
Get-SPSite -Limit All | Format-Table –AutoSize
AutoSize
will be used to format columns depending on screen size. But if you are working with long width tables, you better use Out-String -Width 4000 with output pipe. (4000 is a character count in horizontal. You can mention any suitable value.)
Example
Get-SPSite -Limit All| Format-Table –AutoSize | Out-String -Width 4000
You can use Format-Table with a single object as well.
Example: With all columns
$objAverage = New-Object System.Object
$objAverage | Add-Member -type NoteProperty -name Col1 -value "saman"
$objAverage | Add-Member -type NoteProperty -Name Col2 -Value 23423
$objAverage | Format-Table –AutoSize
Example: With mentioned columns
$objAverage = New-Object System.Object
$objAverage | Add-Member -type NoteProperty -name Col1 -value "saman"
$objAverage | Add-Member -type NoteProperty -Name Col2 -Value 23423
$objAverage | Add-Member -type NoteProperty -Name Col3 -Value 123
$objAverage | Format-Table Col1,Col2 –AutoSize

You can also create object collection, add objects and format it as a table.
$table = @()
$objAverage = New-Object System.Object
$objAverage | Add-Member -type NoteProperty -name Col1 -value "aa"
$objAverage | Add-Member -type NoteProperty -Name Col2 -Value 111
$objAverage | Add-Member -type NoteProperty -Name Col3 -Value 222
$table += $objAverage
$objAverage = New-Object System.Object
$objAverage | Add-Member -type NoteProperty -name Col1 -value "bb"
$objAverage | Add-Member -type NoteProperty -Name Col2 -Value 333
$objAverage | Add-Member -type NoteProperty -Name Col3 -Value 444
$table += $objAverage
$table | Format-Table –AutoSize
