var sqlDataPathRoot = SqlServerPath.Configuration.GetSqlDataRoot;
var drive = sqlDataPathRoot.drive; // e.g. C
var path = sqlDataPathRoot.path; // e.g. Path/To/DataFiles/DATA
SqlServerPath
is also available via NuGet:
PM> Install-Package SqlServerPath Or visit: https://www.nuget.org/packages/SqlServerPath/