Re: PowerShell – Automation – FileTransferProgress – Volume transferred
Thanks very much :)
FileProgress
:
(Get-Item $e.FileName).Length * $e.FileProgress
function FileTransferProgress
{
param($e)
# New line for every new file
if (($script:lastFileName -ne $Null) -and
($script:lastFileName -ne $e.FileName))
{ Write-Host }
# Print transfer progress
Write-Host ("`r{0} ({1:P0})" -f $e.FileName, $e.FileProgress)
# Remember a name of the last file reported
$script:lastFileName = $e.FileName
}
[...] #some stuff
$session.add_FileTransferProgress( { FileTransferProgress($_) } )
[...] #some stuff