After retrieving files from remote move files to archive folder on the remote server
# Iterate over every transfer foreach ($transfer in $transferResult.Transfers) { # Success or error? if ($transfer.Error -eq $Null) { Write-Output ("Download of {0} succeeded, moving to backup" -f $transfer.FileName) | Out-File $LogFile -Append # Upload succeeded, move source file to backup Move-Item $transfer.FileName $arch -Force | Out-File $LogFile -Append
param ( $localPath = "c:\downloaded", $remotePath = "From_Sunset/", $arch = "archive/" )