Asked by:
using InternetExplorer.Application to got multiple URLs

Question
-
I have a PS script like this:
$ie = New-Object -com InternetExplorer.Application $ie.visible=$true $ie.navigate("https://fasttest.usask.ca/StaticLogon.asp?ReturnUrl=%2f") Start-Sleep -seconds 2; $ie.navigate("http://www.usask.ca")
the problem i am having is that the second navigate doesn't work I get this error:
PS C:\Users\rwm132> T:\work\scripts\FastTest.ps1 The interface is unknown. (Exception from HRESULT: 0x800706B5) At T:\work\scripts\FastTest.ps1:13 char:2 + $ie.navigate("http://www.oursite.local") + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (:) [], COMException + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException
how would I once I am at one page on a website via $ie.navigate(URL1) then goto URL2 in that same browser window?
Thursday, September 28, 2017 2:39 PM
All replies
-
The exact code works with no error for me.
\_(ツ)_/
Thursday, September 28, 2017 5:45 PM -
what the!!!
$ie = New-Object -com InternetExplorer.Application $ie.visible=$true $ie.navigate("https://www.usask.ca") Start-Sleep -seconds 2; $ie.navigate("http://engr.usask.ca")
can you try that above.
when I use it I get the error on the 2nd navigate:
PS C:\Users\rwm132> T:\work\scripts\FastTest2.ps1
The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))
At T:\work\scripts\FastTest2.ps1:8 char:2
+ $ie.navigate("http://engr.usask.ca")
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], COMException
+ FullyQualifiedErrorId : System.Runtime.InteropServices.COMException
PS C:\Users\rwm132>Thursday, September 28, 2017 11:24 PM -
Not a scripting issue. I can run that exact code with no issues. Perhaps you have browser problems, malware or proxy issues.
\_(ツ)_/
- Proposed as answer by Albert LingMicrosoft contingent staff Tuesday, October 24, 2017 2:48 AM
Thursday, September 28, 2017 11:33 PM -
yikes ok ill try a fresh vm and see what happens thanks for the heads upFriday, September 29, 2017 3:33 PM
-
Hi,
I'm checking how the issue is going, was your issue resolved?
And if the replies as above are helpful, we would appreciate you to mark them as answers, and if you resolve it using your own solution, please share your experience and solution here. It will be greatly helpful to others who have the same question.
Appreciate for your feedback.
Best Regards,
Albert LingPlease remember to mark the replies as an answers if they help and unmark them if they provide no help.
If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.Thursday, October 5, 2017 2:36 AM