I have two systems that are identical. When I run the following code in powershell. The Document is mshtml.HTMLDocumentClass. But when I run the same code on the other system. The Document is System.__ComObject.
Why is the Document different on the other system. When I try to do a getelementbyID. It works when the document is of type mshtml.HTMLDocumentClass. But it fails when document is of type System.__ComObject.
I have the same version of IE version 11. The same version of powershell version 3.0.
$ie = new-object -com "InternetExplorer.Application"
$ie.navigate("http://localhost:8129/default.aspx")
$ie
Application : System.__ComObject
Parent : System.__ComObject
Container :
Document : mshtml.HTMLDocumentClass
TopLevelContainer : True
Type : HTML Document
Left : 125
Top : 47
Width : 1701
Height : 984
LocationName : Beyond TV
LocationURL : http://localhost:8129/default.aspx
Busy : False
Name : Internet Explorer
HWND : 4392126
FullName : C:\Program Files (x86)\Internet Explorer\IEXPLORE.EXE
Path : C:\Program Files (x86)\Internet Explorer\
Visible : False
StatusBar : True
StatusText :
ToolBar : 1
MenuBar : True
FullScreen : False
ReadyState : 4
Offline : False
Silent : False
RegisterAsBrowser : False
RegisterAsDropTarget : True
TheaterMode : False
AddressBar : True
Resizable : True
$ie = new-object -com "InternetExplorer.Application"
$ie.navigate("http://localhost:8129/default.aspx")
$ie
Application : System.__ComObject
Parent : System.__ComObject
Container :
Document : System.__ComObject
TopLevelContainer : True
Type : HTML Document
Left : 397
Top : 307
Width : 1200
Height : 674
LocationName : Beyond TV
LocationURL : http://localhost:8129/default.aspx
Busy : False
Name : Internet Explorer
HWND : 1116142
FullName : C:\Program Files (x86)\Internet Explorer\IEXPLORE.EXE
Path : C:\Program Files (x86)\Internet Explorer\
Visible : False
StatusBar : False
StatusText :
ToolBar : 1
MenuBar : True
FullScreen : False
ReadyState : 4
Offline : False
Silent : False
RegisterAsBrowser : False
RegisterAsDropTarget : True
TheaterMode : False
AddressBar : True
Resizable : True