Skip to content

Restore-DbaDbSnapshot error handling #7399

Answered by andreasjordan
strange-v asked this question in Q&A
Discussion options

You must be logged in to vote

Have a look at the source code. The command first runs this: Get-DbaDbSnapshot -SqlInstance $server -Database $Database -ExcludeDatabase $ExcludeDatabase -Snapshot $Snapshot.
With an incorrect snapshot name, the Get- command does not return anything. That is by design. If you want to make sure that there is a snapshot with that name, you have to use Get-DbaDbSnapshot yourself and test if there is a result.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@strange-v
Comment options

Answer selected by strange-v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants