PowerShell - Session.FileTransferProgress Event - Frequency

Advertisement

Nebsorg
Joined:
Posts:
4

PowerShell - Session.FileTransferProgress Event - Frequency

Hello !

I'm working on a script which download automatically files on a distant serveur through SSH.

For that, I'm developing a script in Powershell with WinSCP Library. Many Thanks for this nice library and all example provided on your website !

I succeed to trigger the FileTransferProgress event in my code, but as I'm downloaded big piece of software, I would like to slow down the frequency of this trigger.
Presently, it's around every second, and I would like to move to something like every 30 seconds.

Is there a way to modify the frequency of the trigger ?

Thanks for your help !

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: PowerShell - Session.FileTransferProgress Event - Frequency

Why? You do not need to process every call you get. Just use only every 30th call.

Reply with quote

Nebsorg
Joined:
Posts:
4

Thanks Priryl for your answer.

Yes, that what I finally done : I set a variable to make a treatment every x seconds.

However, I think it is more efficient to be able to trigger that call at a choosen rate.

But I have a workaroud, so it's ok :)

Reply with quote

Advertisement

You can post new topics in this forum