However I then want to be able to test each iexplore to see which one is running the web session I am interested in.
I know that I can use $oIE.document.documentElement from above, but what I don’t know is how to do this with the three iexplore sessions that I just identified. Ideally I want to be able to test each of the domains or web address and then grab the .documentElement for that browser.
I have spent a couple of days trying to crack this I seem to be running in circles.
Thanks for the direction so far.
I need to identify each instance of Internet Explorer already running and not start new sessions.
I am doing this via
$Test1 = ( get-process | Where-Object {$_.ProcessName -Eq ‘iexplore’} | select -ExpandProperty mainWindowHandle )
And this gives me a list of windows handles:
396408
199978
330736
789426
What I then need to do is to get access to the IE document properties such as:
$ie.document.documentElement
At the moment I only know how to do this when you create a new-object:
$ie = New-Object -ComObject ‘InternetExplorer.Application’
However, I need to do this for an existing object that I have identified via the windows handle as above.
Thanks