After retrieving files from remote move files to archive folder on the remote server

Advertisement

ajh
Guest

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
I defined
param (
    $localPath = "c:\downloaded",
    $remotePath = "From_Sunset/",
    $arch = "archive/"
)
Doesn't seem to work

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum