Skip to content

Commit

Permalink
maybe fixes #5631
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed May 31, 2019
1 parent 36657ad commit 6f10ff4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions functions/New-DbaDbSnapshot.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ function New-DbaDbSnapshot {

## double check for gotchas
foreach ($db in $dbs) {
if ($db.IsDatabaseSnapshot) {
if ($db.IsMirroringEnabled) {
$InputObject += $db
} elseif ($db.IsDatabaseSnapshot) {
Write-Message -Level Warning -Message "$($db.name) is a snapshot, skipping"
} elseif ($db.name -in $NoSupportForSnap) {
Write-Message -Level Warning -Message "$($db.name) snapshots are prohibited"
Expand All @@ -186,7 +188,7 @@ function New-DbaDbSnapshot {
}
}

if ($InputObject.Length -gt 1 -and $Name) {
if ($PSBoundParameters.InputObject -and $Name) {
Stop-Function -Message "You passed the Name parameter that is fixed but selected multiple databases to snapshot: use the NameSuffix parameter" -Continue -EnableException $EnableException
}
}
Expand Down

0 comments on commit 6f10ff4

Please sign in to comment.