Thor Logo dbatools

Path

Get-DbaFile

Brandon Abshire, netnerds.net

Get-DbaFile View Source Brandon Abshire, netnerds.net Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Enumerates files and directories on remote SQL Server instances using xp_dirtree Description Searches directories on SQL Server machines remotely without requiring direct file system access or RDP connections. Uses the xp_dirtree extended stored procedure to return file listings that can be filtered by extension and searched recursively to specified depths.

Read more

Join-DbaPath

Friedrich Weinmann (@FredWeinmann)

Join-DbaPath View Source Friedrich Weinmann (@FredWeinmann) Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Constructs file paths with correct separators for Windows and Linux SQL Server instances. Description Constructs file paths by joining multiple segments while automatically using the correct path separators (backslash for Windows, forward slash for Linux) based on the target SQL Server instance’s operating system. This function eliminates the guesswork when building file paths for backup files, exports, scripts, or other SQL Server operations that need to reference files on the remote server.

Read more

New-DbaDirectory

Stuart Moore

New-DbaDirectory View Source Stuart Moore Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Creates directories on SQL Server machines using the SQL Server service account Description Creates directories on local or remote SQL Server machines by executing the xp_create_subdir extended stored procedure. This is particularly useful when you need to create backup directories, log shipping paths, or database file locations where the SQL Server service account needs to have access.

Read more

Resolve-DbaPath

Friedrich Weinmann (@FredWeinmann)

Resolve-DbaPath View Source Friedrich Weinmann (@FredWeinmann) Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Validates and resolves file system paths with enhanced error handling and provider verification. Description Validates and resolves file system paths with additional safety checks beyond PowerShell’s built-in Resolve-Path cmdlet. This function ensures paths exist and are accessible before performing database operations like backups, restores, or log file management.

Read more

Test-DbaPath

Chrissy LeMaire (@cl), netnerds.net

Test-DbaPath View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Tests if files or directories are accessible to the SQL Server service account. Description Verifies file and directory accessibility from SQL Server’s perspective using the master.dbo.xp_fileexist extended stored procedure. This is essential before backup operations, restore tasks, or any SQL Server process that requires file system access.

Read more