The script is available for download from http://gallery.technet.microsoft.com/Get-the-information-of-9fcf67d7. 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 T-SQL script will demo how to get the information of used/free space of all SQL Server databases in an instance.
As some people asked how to get the used or free space of all database in a SQL Server, this script will demo how to get the following information:
- total size of data file(s)
- total size of log file(s)
- used space size of data file(s) +log file(s)
- free space size of data file(s) + log file(s)
- size of every data file and log file
You can find more All-In-One Script Framework script samples at https://aka.ms/onescriptingallery