Created
November 24, 2017 11:15
-
-
Save Stuart-Moore/39ac060bd7904c900eac9575d03f0008 to your computer and use it in GitHub Desktop.
Create multiple environments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$BackupInformation = Get-DbaBackupInformation -sqlinstance localhost\sqlexpress2016 -Path C:\dbatools\RestoreTimeDiffDemo | |
$Environments = @('Dev','Test','Stage') | |
ForEach ($Environment in $Environments){ | |
$BackupInformation | Restore-DbaDatabase -sqlinstance localhost\sqlexpress2016 -DestinationFilePrefix $Environment -RestoredDatababaseNamePrefix ("$($Environment)_") -TrustDbBackupHistory | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment