Script Download: The script is available for download from http://gallery.technet.microsoft.com/How-to-check-if-SQL-Server-af01ebb9 (SQL) and http://gallery.technet.microsoft.com/How-to-check-if-SQL-Server-23bace0c (powershell). You can also use Microsoft Script Browser for Windows PowerShell ISE to download the sample with one button click from within your scripting environment.
Only files associated with a database snapshot should be marked as sparse files. If a regular database is marked as a sparse file, you might encounter unexpected performance degradation and errors during normal activities. This script will find all the database files marked as sparse files in an instance.
Some people asked how to check if SQL Server database files marked as sparse files. This script will help demo how to find out all the database files marked as sparse files.
You can find more All-In-One Script Framework script samples at http://aka.ms/onescriptingallery
Thanks for sharing this information it was very helpful.