Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for WinSCP Events like FileTransferred or FileTransferProgress #136

Open
aurel-appsthru opened this issue Oct 4, 2021 · 3 comments

Comments

@aurel-appsthru
Copy link

aurel-appsthru commented Oct 4, 2021

Issue Description

Hello, it would be great if we could add event support like FileTransferred or FileTransferProgress !

https://winscp.net/eng/docs/library_session#events

THX

@tomohulk
Copy link
Owner

tomohulk commented May 1, 2023

Can you elaborate on this? I'm not sure how to really implement this pwsh. Can you give me an example of how you would see it working, and a situation where you would use it?

@larsskogshusabf
Copy link

I would like a simple progresbar like this:
image
$session.add_FileTransferProgress( { FileTransferProgress($_) } ) would need to be implemented in New-WinSCPSession.ps1 before opening the session.

I dont know where the best place for the function would be. (mine looks like this)

function FileTransferProgress
{
    param($e)
 
    Write-Progress `
        -Id 1 -Activity "Transfering" -Status ("{0:P0} complete:" -f $e.OverallProgress) `
        -PercentComplete ($e.OverallProgress * 100)
    Write-Progress `
        -Id 2 -ParentId 1 -Activity $(([String]$e.FileName).Substring($e.FileName.length - 30,30))  -Status ("{0:P0} complete:" -f $e.FileProgress) `
        -PercentComplete ($e.FileProgress * 100)
}

https://winscp.net/eng/docs/library_session_filetransferprogress

@thomas-tarp
Copy link

Agree - this would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants