So, I have a script which shows Download Progress from FTP.
I just try many ways to solve this task.
One of the conclusions was that cmdlet Register-ObjectEvent is a really bad idea.. Async eventing is rather poorly supported in Powershell...
And I stopped there -
$webclient.add_DownloadProgressChanged([System.Net.DownloadProgressChangedEventHandler]$webclient_DownloadProgressChanged )
....
$webclient_DownloadProgressChanged = {
param([System.Net.DownloadProgressChangedEventArgs]$Global:e)
$progressbaroverlay1.value=$e.ProgressPercentage
....
}
And everything in this sript works fine, but you can understand that I did this was for a one file.
But then I started thinking - How I can download several files at the same time and show it in a one progress bar?
So anyone have any great ideas? Or best way to solve this task?
P.S
WebClient can only download one file at a time.
Of course, I know it.