I wrote a script to parse a HTML file. I have three machines, Windows 8.1, Windows Server 2012, and Windows Server 2008.
I use the COM object and method $ie.Document.getElementById()
to get element in HTML file. The script runs without any problem in Windows 8.1, but is not working in Windows Server 2012 and Windows Server 2008. It shows $ie.Document
is null object.
I searched for a while and found that there is a bug with COM object. So I imported manually Microsoft.mshtml.dll, now script runs well in win server 2012, but still not working under win server 2008. I can see all properties by using $ie.document | Get-Member
, but the object $ie.Document
is always null.