We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5f8e04b commit 5d74f6cCopy full SHA for 5d74f6c
1 file changed
source/Public/Restore-SqlDscDatabase.ps1
@@ -446,17 +446,18 @@ function Restore-SqlDscDatabase
446
{
447
$restore.NoRecovery = $true
448
}
449
+ elseif ($PSBoundParameters.ContainsKey('Standby'))
450
+ {
451
+ # When using Standby mode, NoRecovery must be set to true
452
+ $restore.NoRecovery = $true
453
+ $restore.StandbyFile = $Standby
454
+ }
455
else
456
457
# Explicitly set NoRecovery to false to ensure the database is brought online
458
$restore.NoRecovery = $false
459
460
- if ($PSBoundParameters.ContainsKey('Standby'))
- {
- $restore.StandbyFile = $Standby
- }
-
461
if ($ReplaceDatabase.IsPresent)
462
463
$restore.ReplaceDatabase = $true
0 commit comments