The script is available for download from http://gallery.technet.microsoft.com/How-to-check-SQL-Server-b14d9b82. You can also use Microsoft Script Browser for Windows PowerShell ISE to download the sample with one button click from within your scripting environment.
This PowerShell script will demo how to check if the latest database backup sets among all the databases in an instance are marked as damaged.
As some people want to know if a latest database backup set is damaged or not before they restore a database to avoid giving up restoring halfway, it is nice if we can provide a script to do this.
You can find more All-In-One Script Framework script samples at https://aka.ms/onescriptingallery