Isaiah Melendez
asked on
Powershell Script - Download File and Show Progress Bar
Hello, Experts!
I am needing a script help with showing a progress bar when downloading a big file.
Here is my script:
I would like for when the download kicks off it shows a progress bar in the output window as to how far you are in the download.
I am needing a script help with showing a progress bar when downloading a big file.
Here is my script:
Invoke-WebRequest -Uri https://url/to/file/filename.7z -OutFile C:\temp\NLB.7z
I would like for when the download kicks off it shows a progress bar in the output window as to how far you are in the download.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This worked for me, thanks, Jose!
Open in new window
this will create a background job that can be accessed using the regular event handling for .NETDescribed here:
https://learn-powershell.net/2013/02/08/powershell-and-events-object-events/
Using that logic it can be archived the progress bar
You can subscribe these events and should register using PS commands.
$wc.DownloadProgressChange
$wc.DownloadDataCompleted