Private/Start-GreyhoundServerTransfer.ps1
function Start-GreyhoundServerTransfer { [CmdletBinding()] param ( [Parameter(Mandatory=$true, ValueFromPipeline)] [String]$Path, [String]$Destination ) if (!(Test-Path $Path)) { Write-Host "Der Quellpfad '$Path' existiert nicht." Break } if (!(Test-Path $Destination)) { Write-Host "Der Zielpfad '$Destination' existiert nicht." Break } $RcSource = $Path.TrimEnd('\') $RcDestination = $Destination.TrimEnd('\') $RcExclusionFiles = @("*.bak", "*.exe", "*.dll", "*.log", "*.txt", "*.ini", "*.eml") $RcExclusionDirs = @("Antispam", "ItemCount", "Keys", "Logs", "MariaDB", "MonitorLogs", "MySQL", "Plugins", "Temp", "Updates") $RcOptions = @("/NODCOPY", "/MIR", "/NP", "/R:5", "/W:15", "/MT:16", "/XF $RcExclusionFiles", "/XD $RcExclusionDirs") $RcArgumentList = @( "`"$RcSource`"", "`"$RcDestination`"", "$RcOptions" ) Start-Process -FilePath robocopy -ArgumentList $RcArgumentList -Wait -NoNewWindow } |