internal/configurations/settings/paths.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<#
This is designed for all paths you need configurations for.
#>


# The default path where dbatools stores persistent data
Set-DbaConfig -FullName 'Path.DbatoolsData' -Value "$env:AppData\PowerShell\dbatools" -Initialize -Validation string -Handler {  } -Description "The path where dbatools stores persistent data on a per user basis."

# The default path where dbatools stores temporary data
Set-DbaConfig -FullName 'Path.DbatoolsTemp' -Value ([System.IO.Path]::GetTempPath()).TrimEnd("\") -Initialize -Validation string -Handler { } -Description "The path where dbatools stores temporary data."

# The default path for writing logs
Set-DbaConfig -FullName 'Path.DbatoolsLogPath' -Value "$env:AppData\PowerShell\dbatools" -Initialize -Validation string -Handler { [Sqlcollaborative.Dbatools.Message.LogHost]::LoggingPath = $args[0] } -Description "The path where dbatools writes all its logs and debugging information."

# The default Path for where the tags Json is stored
Set-DbaConfig -FullName 'Path.TagCache' -Value "$ModuleRoot\bin\dbatools-index.json" -Initialize -Validation string -Handler { } -Description "The file in which dbatools stores the tag cache. That cache is used in Find-DbaCommand for more comfortable autocomplete"

# The default Path for the server list (Get-DbaServerList, etc)
Set-DbaConfig -FullName 'Path.Servers' -Value "$env:AppData\PowerShell\dbatools\servers.xml" -Initialize -Validation string -Handler { } -Description "The file in which dbatools stores the current user's server list, as managed by Get/Add/Update-DbaServerList"