Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 5 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
The directories have thousands of files but I see the progressbar only increase when the copy of the entire dir is completed while I would like the progression to be shown when copying all the files. How could I modify the script to get all this? Thank you
That is correct. A recursive copy blocks the thread until it is complete. Use the Job Tracker custom control set to create a job that displays a progress indicator.
The link I posted has complete instructions and an explanation that is better than I can do in a post. If this is your first time using PowerShell with forms you may need to take some time to read other articles on forms development.
If you just create a new form and add the control it serves as a demo of how the Job Tracker works.
I should also note that you file copy code does not make much sense. Why use recurse with a single file? Why do you need to rebuild the file name to copy it. Just copy the file.
It is much faster and more efficient to use RoboCopy to copy a large number of files.
This topic is 5 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.