Add-PSSnapin Microsoft.SharePoint.Powershell -EA 0 

$databases = ("Content_Upgrade_AU","Content_Upgrade_NZ","Content_Upgrade_CA","Content_Upgrade_US","Content_Upgrade_Projects")

foreach ($db in $databases)
  {
    $dbServer = "SQL-12"
    $webApp = "http://projects.contoso.local"
    $outFileLocation = "c:\testLogs-Projects\" + $db + ".txt"

    Test-SPContentDatabase -name $db -webapplication $webApp -ServerInstance $DbServer -ShowRowCounts | out-file $outFileLocation
  }