diff --git a/public/Restore-DbaDatabase.ps1 b/public/Restore-DbaDatabase.ps1 index 6d921de165..5d9d63557d 100644 --- a/public/Restore-DbaDatabase.ps1 +++ b/public/Restore-DbaDatabase.ps1 @@ -650,8 +650,9 @@ function Restore-DbaDatabase { Write-Message -Message "$Database does not exist on $RestoreInstance" -level Warning continue } - if ($RestoreInstance.Databases[$Database].Status -ne "Restoring") { - Write-Message -Message "$Database on $RestoreInstance is not in a Restoring State" -Level Warning + + if (@("Restoring", "Normal, Standby") -notcontains $RestoreInstance.Databases[$Database].Status) { + Write-Message -Message "$Database on $RestoreInstance state [$($RestoreInstance.Databases[$Database].Status)] is not a valid state. Valid state is Restoring or Standby" -Level Warning continue } $RestoreComplete = $true @@ -807,7 +808,6 @@ function Restore-DbaDatabase { } catch { Stop-Function -Message "Failure" -ErrorRecord $_ -Continue -Target $RestoreInstance } - if ($PSCmdlet.ParameterSetName -eq "RestorePage") { if ($RestoreInstance.Edition -like '*Enterprise*') { Write-Message -Message "Taking Tail log backup for page restore for Enterprise" -Level Verbose