This script queries each SQL instance in the farm and returns information on the data, filestream, and log files that make up each database in the farm. This script easily be modified to return other properties as well. Use this script to enumerate each database, it's location, it's size, autogrowth settings, etc. Many best practice violations can be found from this information. 

PowerShell
Edit|Remove
#############################################################################################
# GetDatabaseFileProperties
#   	
# Returns important information about the data and log files of each database in the farm
# User must have rights to query master database
#############################################################################################

## Add the SharePoint SnapIn just in case this script wasnt run in the SharePoint mgmt console
Add-PSSnapin Microsoft.SharePoint.PowerShell;

## Enumerate each service instance
get-spserviceinstance -all | foreach-object {

	## Locate the database service instance(s)
	if ($_.typeName -eq "Microsoft SharePoint Foundation Database") {
	
		Write-Host "Databases on"$_.Server.Name
		## Create a connection to the master DB using the sql instance name and default integrated security
		$connString = "Provider=sqloledb;Data Source=" + $_.Server.Name + ";Initial Catalog=Master;Integrated Security=SSPI;"
		$conn = New-Object System.Data.OleDb.OleDbConnection $connString
		
		## Enumerate each DB on this instance and query sys.databases for important info
		foreach ($Database in $_.Databases){
		
		Write-Host "Database:" $Database.Name
		## Create a DataSet for storing Database Properties which we'll need later
		$dataset = New-Object System.Data.DataSet
		
			$FilePropSQLString = "SELECT f.name, 
							f.database_id,
							f.physical_name, 
							f.state_desc,
							f.size,
							f.max_size,
							f.growth,
							f.is_percent_growth
		
						FROM sys.master_files f, sys.databases d
						WITH (NOLOCK)
						WHERE f.database_id = d.database_id and					
								d.name='" + $Database.Name + "'";
								
			## Create an OleDb command object to execute our query
			$cmd = New-Object System.Data.OleDb.OleDbCommand $FilePropSQLString,$conn
			$conn.Open()
			
			## Create a data adapter to handle our query data 
			$adapter = New-Object System.Data.OleDb.OleDbDataAdapter $cmd
			
			## Load our data into our DataSet
			[void] $adapter.Fill($dataSet, "Database")
			
			## Close our connection to SQL to keep things tidy
			$conn.Close()
			
			## Count the databases we found
			$Count = $dataset.Tables[0].Rows.Count
			if ($Count -lt 1) {$Count = "0"}
			Write-Host "Files Count ="$Count
			
			## Get all the data we pulled back from our query 
			$dataSet.Tables | Select-Object -Expand Rows	
		}
		
	}
}