Using PowerShell creating IE object and navigating to a web page works fine:
$ie = new-object -com InternetExplorer.Application
$ie.visible = $true
$ie.navigate("https://login.microsoftonline.com/login.srf")
But when trying to access document objects while document mode is Edge this fails:
$ie.document.GetElementById("This_is_unique_ID").click()
The error PowerShell throws is "Cannot find an overload for "getElementByID" and the argument count: "1"
When inspecting $ie.document it's empty.
.. but when setting ie document mode by F12 to IE8 it works fine.
What is controlling this access to elements? Could it be some security setting?
Can we set that security setting from PowerShell?
This is not happening on all computers and all computers should be more or less std W7 pro. We have tried what ever internet offers but not help. Compatibility does not help. IE settings are the same. We have tried with different compatibility modes and with installations of IE8, IE9, IE10 and IE11, but there's no consistent result of working.
Is there any other environment variables that would cause this kind of behavior?