Skip to content

Instantly share code, notes, and snippets.

@Stuart-Moore
Created November 25, 2017 21:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Stuart-Moore/54b7e967097b6467047fa6790ab4c95f to your computer and use it in GitHub Desktop.
Save Stuart-Moore/54b7e967097b6467047fa6790ab4c95f to your computer and use it in GitHub Desktop.
Parallel Header scans on single server
Import-Module poshrsjob
$folders = ('C:\dbatools\RestoreTimeClean','C:\dbatools\RestoreTimeDiffDemo','c:\dbatools\restoretimeDiff')
$job = $Folders | Start-RsJob -ModulesToImport dbatools -ScriptBlock {
param($Folder)
Get-DbaBackupInformation -SqlInstance localhost\SqlExpress2016 -Path $Folder
}
$job | Wait-RsJob -ShowProgress
$BackupInformation = $job | Receive-RsJob
Get-RsJob | Remove-RSJob
$BackupInformation | Restore-DbaDatabase -SqlInstance Server1\Instance -TrustDbBackupHistory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment