Skip to content

Commit

Permalink
Snapshot maybe fixes #5631 (#5660)
Browse files Browse the repository at this point in the history
* maybe fixes #5631

* fix that
  • Loading branch information
potatoqualitee authored May 31, 2019
1 parent e782fd2 commit 602e263
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 ($InputObject.Count -gt 1 -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 602e263

Please sign in to comment.