Very useful script. I have been doing some sp_spaceused manually to collect this data until I could write this, thanks for sharing a workable solution. I did run...
I would suggest you also add to your “restore” process a note about attempting a tail-log backup before you start your restore process. If your recovery model is full...