Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

ajh

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