Code Downloads & Errata
- Download the code or support files
- View errata and amendments
- Send us feedback
SQL Server 2012 with PowerShell V3 Cookbook
Please register your e-mail address to download files. We will e-mail you with a direct link to the code download. If you have bought this book, you can login to your account and download the code files from your account page.
Errata- 3 submitted: last submission 31 Jan 2017
Errata type: Typo | Page number: 342
You can use the script 6464 - Ch05 - 11 - Perform an Online PieceMeal Restore - Prep.ps1 to create your files, which is included in the downloadable files for this book.
You can use the script 6464 - Ch06 - 11 - Perform an Online PieceMeal Restore - Prep.ps1 to create your files, which is included in the downloadable files for this book.
Errata type: Code | Page number: 339
To restore our database, we are simply going to use the Backup-SqlDatabase cmdlet.
To restore our database, we are simply going to use the Restore-SqlDatabase cmdlet.
Errata type: Code | Page number: 334 and 335
The list of backups is displayed in descending order. The following code is retrieving the earliest full backup, not the latest.
#look for the last full backupfile #you can be more specific and specify filename $fullBackupFile = Get-ChildItem $backupfilefolder -Filter "*Full*" | Sort -Property LastWriteTime -Descending | Select -Last 1
So, the correct code should be either: Select -First 1 or remove the -Descending attribute from the Sort statement.