You probably can't. The old IE COM object doesn't provide that kind of callback to let your code know the download is done. And there's nothing native in PowerShell to do this; what people will usually do is instantiate a WebRequest object in .NET and request the specific file from the web server. The .NET class provides asynchronous callbacks, meaning you provide a chunk of code to run once the download is done. There are some third-party modules that work similarly. But that IE COM object is over a decade old, isn't updated anymore (it's officially deprecated, and it'll probably start to go away with the shift to Edge), and just doesn't provide a lot of advanced functions.
The topic ‘Download File with IE’ is closed to new replies.