How can I hide the progress display of Invoke-WebRequest
? I do a lot of successive requests and have my own Write-Progress
display that I use, so I don't need the built-in one popping up underneath it every time.
I use the mshtml results (the IE COM object) that are created from the result of Invoke-WebRequest
automatically, so I can't switch to a WebClient
or something like that, unless someone provides instructions on how to get an mshtml object from a WebClient request.
Use the $progressPreference variable. It should have a value of 'Continue' by default unless you've edited it elsewhere, which tells Powershell to display the progress bar. Since you mentioned that you have your own custom progress displays, I would reset it immediately after the cmdlet is executed. For example:
More info on preference variables at about_preference_variables. Here's the entry for $ProgressPreference: