I am noticing in my script that Invoke-WebRequest
is launching Internet Explorer (presumably to parse the DOM). Is there a way to close down these IE sessions at the end of my script, for cleanup purposes?
The line highlighted in red is the iwr
which prompts Internet Explorer to open. If I add -UseBasicParsing
to that $AllRegs request, the script fails a couple lines later, trying to capture $LibraryID
To forcefully close all IE sessions use:
To more gracefully close IE sessions use:
You can also add a wait after the ForEach call, but I use the same line for shutting Chrome down & it has never been necessary.