Your string formatting is buggy, see:
Odd error after running for 6+ hours
Odd error after running for 6+ hours
function FileTransferProgress
{
param ($e)
Write-Progress `
-Id 0 -Activity "Downloading" -CurrentOperation ("$($e.FileName) - {0:P0}" -f $e.FileProgress) -Status ("{0:P0} complete at $($e.CPS) bps" -f $e.OverallProgress) `
-PercentComplete ($e.OverallProgress * 100)
}
Session.SynchronizeDirectories
does not report overall progress.
Session.GetFiles
does.
Write-Progress
with Session.GetFiles
at the end of: