Public/Copy-mssToCentralPath.TempPoint.ps1

function Get-mssDefaultOutputPath
{
    $path = Get-mssConfig -Key 'OutputPath'
    if (-not $path) { $path = 'C:\System\WinSrvLog\MSSQL' }
    return $path
}

function Copy-mssToCentralPath
{
    [CmdletBinding()]
    param ([string[]]$Path)
    $central = Get-mssConfig -Key 'CentralPath'
    if (-not $central) { return }
    if (-not (Test-Path $central))
    {
        try
        {
            New-Item -ItemType Directory -Path $central -Force -ErrorAction Stop | Out-Null
        }
        catch
        {
            Write-Warning "CentralPath '$central' konnte nicht erstellt werden: $($_.Exception.Message)"
            return
        }
    }
    foreach ($file in $Path)
    {
        if (Test-Path $file)
        {
            $dest = Join-Path $central (Split-Path $file -Leaf)
            Copy-Item -Path $file -Destination $dest -Force -ErrorAction SilentlyContinue
            Write-Verbose "Datei '$file' nach '$dest' kopiert (CentralPath)."
        }
    }
}