Skip to content

Commit

Permalink
Use Stop-Function to support EnableException (do Backup-DbaDatabase)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasjordan committed Apr 3, 2024
1 parent 86b3f3d commit 1e19dff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion public/Restore-DbaDatabase.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ function Restore-DbaDatabase {
Write-Message -Message "$DbVerfied passed testing" -Level Verbose
if ((@($FilteredBackupHistory | Where-Object { $_.IsVerified -eq $True })).count -lt $FilteredBackupHistory.count) {
$DbUnVerified = ($FilteredBackupHistory | Where-Object { $_.IsVerified -eq $False } | Sort-Object -Property Database -Unique).Database -join ','
Write-Message -Level Warning -Message "Database $DbUnverified failed testing, skipping"
Stop-Function -Message "Database $DbUnverified unable to be restored, see warnings for details"
}
If ($PSCmdlet.ParameterSetName -eq "RestorePage") {
if (($FilteredBackupHistory.Database | Sort-Object -Unique | Measure-Object).count -ne 1) {
Expand Down

0 comments on commit 1e19dff

Please sign in to comment.