PowerShell Get site collection disk size

#Large amounts of memory are often required when SPWeb, SPSite, or SPSiteAdminsitration objects are used. So the use of these objects, or lists of these objects,
#in Windows PowerShell scripts requires proper memory management. By default, all Get commands dispose of these objects immediately after the pipeline finishes,
#but by using SPAssignment, you can assign the list of objects to a variable and dispose of the objects after they are no longer needed. You can also ensure that
#the objects remain as long as you need them, even throughout multiple iterations of commands.

# The amount of disk space that is displayed does not include the disk space used by the auditing data that will be moved with the site collection.
# ref https://technet.microsoft.com/en-us/library/ee125874(v=office.14).aspx

Start-SPAssignment -Global
$SiteUrl = “http://yourdomain/sitename”
$diskSizeBytes = (Get-SPSiteAdministration -Identity $SiteUrl).DiskUsed
$diskSizeMB = ($diskSizeBytes/1024)/1024
$diskSizeGB = ($diskSizeMB/1024)

write-host $SiteUrl “–>” ([math]::Round($diskSizeGB,2))  “GB”
Stop-SPAssignment -global

Get list of all site collection on the farm in a table format

Get-SPSite -Limit All | Select Url,ContentDatabase | Format-Table -Wrap -AutoSize > D:\Output\ShowAllSCs.txt

All Site Collections in a certain Content Database:
Get-SPSite -Limit All -ContentDatabase | Format-Table -Wrap -AutoSize > D:\Output\ShowSCsInContentDB.txt

All Site Collections in a certain Web Application:
Get-SPWebApplication https://webapplication.domain.com | Get-SPSite -Limit All | Select Url,ContentDatabase | Format-Table -Wrap -AutoSize > D:\Output\ShowAllSCsInWA.txt