Commands / Copy-sqmToCentralPath
Copy-sqmToCentralPath
Filesystem sqmSQLTool v1.8.2+ · Utility
Copies one or more files to the CentralPath defined in the module configuration (Get-sqmConfig -Key 'CentralPath'). The function is designed as a silent helper — if no CentralPath is configured it returns immediately without error. Source files that do not exist are skipped with a Write-Verbose message.

If the configured CentralPath directory does not yet exist it is created automatically. A failure to create it produces a warning and the function exits. Each file is copied with Copy-Item -Force -ErrorAction SilentlyContinue; the filename at the destination is the leaf name of the source path.

Parameters

ParameterTypeRequiredDefaultNotes
-Pathstring[]RequiredOne or more file paths to copy to CentralPath. Missing files are silently skipped.

Execution Flow

START CentralPath configured? NO return (silent, no error) YES CentralPath exists? NO New-Item Directory -Force fail → warn + return YES foreach $file in $Path Test-Path $file exists → dest = Join-Path $central (Split-Path $file -Leaf) → Copy-Item -Force not found → Write-Verbose "übersprungen" (skip) DONE

Examples

Copy a single report file to CentralPath
Copy-sqmToCentralPath -Path "C:\Reports\DBHealth_2026-06-30.html"
Copy multiple files at once
Copy-sqmToCentralPath -Path @("C:\Reports\report1.html", "C:\Reports\report2.txt")