.PARAMETER Database
Specifies the database(s) to process. Options for this list are auto-populated from the server. If unspecified, all databases will be processed.

.PARAMETER ExcludeDatabase
Specifies the database(s) to exclude from processing. Options for this list are auto-populated from the server.

.PARAMETER RecoveryModel
Specifies the type of recovery model you wish to test. By default it will test for FULL Recovery Model.

.PARAMETER Detailed
Output all properties, will be deprecated in 1.0.0 release.

.PARAMETER EnableException
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

Shows all of the properties for the databases that have Full Recovery Model
#>[CmdletBinding()][OutputType("System.Collections.ArrayList")]Param([parameter(Mandatory=$true,ValueFromPipeline=$true)][Alias("ServerInstance","SqlServer")][DbaInstanceParameter[]]$SqlInstance,[Alias("Databases")][object[]]$Database,[object[]]$ExcludeDatabase,[PSCredential]$SqlCredential,[validateSet("Full","Simple","Bulk_Logged")][object]$RecoveryModel,[switch]$Detailed,[Alias('Silent')][switch]$EnableException)begin{Test-DbaDeprecation-DeprecatedOn1.0.0-ParameterDetailedTest-DbaDeprecation-DeprecatedOn1.0.0-AliasTest-DbaFullRecoveryModel

$sqlRecoveryModel="SELECT SERVERPROPERTY('MachineName') AS ComputerName,
ISNULL(SERVERPROPERTY('InstanceName'), 'MSSQLSERVER') AS InstanceName,
SERVERPROPERTY('ServerName') AS SqlInstance
, d.[name] AS [Database]
, d.recovery_model AS RecoveryModel
, d.recovery_model_desc AS RecoveryModelDesc
, CASE
WHEN d.recovery_model = 1 AND drs.last_log_backup_lsn IS NOT NULL THEN 1
ELSE 0
END AS IsReallyInFullRecoveryModel
FROM sys.databases AS D
INNER JOIN sys.database_recovery_status AS drs
ON D.database_id = drs.database_id
WHERE d.recovery_model = $recoveryCode"

if($Database){$dblist=$Database-join"','"$databasefilter+="AND d.[name] in ('$dblist')"}if($ExcludeDatabase){$dblist=$ExcludeDatabase-join"','"$databasefilter+="AND d.[name] NOT IN ('$dblist')"}

$sql="$sqlRecoveryModel $databasefilter"

Write-Message-LevelDebug-Message$sql}process{foreach($instancein$SqlInstance){try{Write-Message-LevelVerbose-Message"Connecting to $instance."$server=Connect-SqlInstance-SqlInstance$instance-SqlCredential$sqlcredential-MinimumVersion9}catch{Stop-Function-Message"Failure"-CategoryConnectionError-ErrorRecord$_-Target$instance-Continue}

try{$results=$server.Query($sql)

if(-not$results){Write-Message-LevelVerbose-Message"Server '$instance' does not have any databases in the $RecoveryModel recovery model."}