You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WARNING: [22:51:36][Restore-DbaDatabase] Multiple Databases' backups passed in, but only 1 name to restore them under. Stopping as cannot work out how to proceed
Expected Behavior
That it continues on because there is only really one database in the Backup History.
Actual Behavior
Select-Object -Unique is case sensitive, so I ended up having the Restore-DbaDatabase terminate because there appeared to be 2 databases passed in even though there was only 1.
If you change the Select-Object -Unique to Sort-Object -Unique it will not give that error if there happens to be DEMODB and demodb in the list of database History records. Select-Object and Get-Unique are case sensitive and Sort-Object is not.
The text was updated successfully, but these errors were encountered:
Before submitting a bug report:
Collect output of following command and paste below:
PowerShell version:
Name Value
PSVersion 5.1.17763.316
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.316
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
dbatools Module version:
Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.812\dbatools.psd1
Version : 0.9.812
Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.804\dbatools.psd1
Version : 0.9.804
Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.801\dbatools.psd1
Version : 0.9.801
Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.797\dbatools.psd1
Version : 0.9.797
Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.793\dbatools.psd1
Version : 0.9.793
Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.784\dbatools.psd1
Version : 0.9.784
Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.773\dbatools.psd1
Version : 0.9.773
Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.771\dbatools.psd1
Version : 0.9.771
Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.701\dbatools.psd1
Version : 0.9.701
Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.518\dbatools.psd1
Version : 0.9.518
Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.418\dbatools.psd1
Version : 0.9.418
Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.333\dbatools.psd1
Version : 0.9.333
Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.324\dbatools.psd1
Version : 0.9.324
Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.321\dbatools.psd1
Version : 0.9.321
Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\0.9.307\dbatools.psd1
Version : 0.9.307
Copy-DbaDatabase
? You can replicate it usingBackup-DbaDatabase ... | Restore-DbaDatabase ...
Environmental data
SQL Server:
/* REPLACE WITH output of @@VERSION */
Errors Received
<# OUTPUT of $error[0] | select * #>
Steps to Reproduce
$istoryObject = Get-DbaBackupHistory -SqlInstance localhost -Database DEMODB
$istoryObject | Restore-DbaDatabase -SqlInstance localhost -DatabaseName DEMODB_copy -TrustDbBackupHistory -ReplaceDbNameInFile -OutputScriptOnly
WARNING: [22:51:36][Restore-DbaDatabase] Multiple Databases' backups passed in, but only 1 name to restore them under. Stopping as cannot work out how to proceed
Expected Behavior
That it continues on because there is only really one database in the Backup History.
Actual Behavior
Select-Object -Unique is case sensitive, so I ended up having the Restore-DbaDatabase terminate because there appeared to be 2 databases passed in even though there was only 1.
If you change the Select-Object -Unique to Sort-Object -Unique it will not give that error if there happens to be DEMODB and demodb in the list of database History records. Select-Object and Get-Unique are case sensitive and Sort-Object is not.
The text was updated successfully, but these errors were encountered: