Differences

This shows you the differences between the selected revisions of the page.

2016-09-19 2017-10-04
limitation of the simple script (martin) using variable expansion in strings in powershell (martin)
Line 41: Line 41:
            if ($transfer.Error -eq $Null)             if ($transfer.Error -eq $Null)
            {             {
-                Write-Host ("Upload of {0} succeeded, moving to backup" -f +                Write-Host "Upload of $($transfer.FileName) succeeded, moving to backup"
-                    $transfer.FileName)+
                # Upload succeeded, move source file to backup                 # Upload succeeded, move source file to backup
                Move-Item $transfer.FileName $backupPath                 Move-Item $transfer.FileName $backupPath
Line 48: Line 47:
            else             else
            {             {
-                Write-Host ("Upload of {0} failed: {1}" -+                Write-Host "Upload of $($transfer.FileName) failed: $($transfer.Error.Message)"
- ···················$transfer.FileName, $transfer.Error.Message)+
            }             }
        }         }

Last modified: by martin