troubleshootingsql.com
Getting the Default Data and Log path using PowerShell
I remember a while back being asked about a way to fetch the Default Data and Log path for a SQL Server instance. This information is present in the registry keys and the keys are created only if y…