Confirmed.. the { and } appear to be causing me issues.
This appears to be where I pulled the original code from:
https://winscp.net/forum/viewtopic.php?t=25223#79401
I expanded upon and updated my code to account for the { and } characters and added some alerting. I'm re-testing but I think you may have figured this one out.
The new code is now:
This appears to be where I pulled the original code from:
https://winscp.net/forum/viewtopic.php?t=25223#79401
I expanded upon and updated my code to account for the { and } characters and added some alerting. I'm re-testing but I think you may have figured this one out.
The new code is now:
function FileTransferProgress {
param ($e)
try {
# Escape each special character's
$Escaped_Filename = $e.FileName -replace '\{', '{{' -replace '\}', '}}'
$Current_FileProgress = $e.FileProgress
$Current_CPS = $e.CPS
$Current_OverallProgress = $e.OverallProgress
Write-Progress -Id 0 -Activity "Synching" -CurrentOperation ("$Escaped_Filename - {0:P0}" -f $Current_FileProgress) -Status ("{0:P0} complete at $Current_CPS bps" -f $Current_OverallProgress) -PercentComplete ($Current_OverallProgress * 100)
}
catch {
Write-Host "Error Hit in FileTransferProgress"
Write-Host "Escaped_Filename: $Escaped_Filename"
Write-Host "Current_FileProgress: $Current_FileProgress"
Write-Host "Current_CPS: $Current_CPS"
Write-Host "Current_OverallProgress: $Current_OverallProgress"
}
}