dbatools is a free PowerShell module with over 300 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


Get-DbaDefaultPath

Gets the default SQL Server paths for data, logs and backups.

Screenshots

dbatools-Get-DbaDefaultPath

Examples

Returns the default file paths for sql01\sharepoint.

Get-DbaDefaultPath -SqlInstance sql01\sharepoint

Returns the default file paths for “sql2014″,”sql2016” and “sqlcluster\sharepoint”.

$servers = “sql2014″,”sql2016”, “sqlcluster\sharepoint”
$servers | Get-DbaDefaultPath

Author

This command was created by Chrissy LeMaire. You can find Chrissy on Twitter.

Get-Help

From PowerShell, execute Get-Help Get-DbaDefaultPath -Detailed for more information on this function.

Source Code

Want to see the source code? View Get-DbaDefaultPath.ps1 on GitHub
 

Related commands