Please feel free to provide feedback or file bugs here.

[Bug] IE automation script will no longer work in PowerShell version 5

To be better notified of incoming tickets in our ticket system I developed a script that opens a hidden IE instance:

$ie = New-Object -ComObject InternetExplorer.Application
(I tried the respective registry entry and "$ie = new-object -Com InternetExplorer.ApplicationMedium", no better.)

(This input box is too small.)

After some script statements to log in and navigate to the incoming tickets monitor, I do a

$newcalls = $ie.Document.getElementsByName("callid")

(This input box is too small.)

That's working perfectly fine in PowerShell version 4, but in v5 I get

Exception from HRESULT: 0x800A138A
At <path>.ps1:89
char:5
+ $newcalls = $ie.Document.getElementsByName("callid")
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], COMException
+ FullyQualifiedErrorId : System.Runtime.InteropServices.COMException

(This input box is too small.)

I started the new powershell instance with -Version 4.0, no difference.

Windows 7, installed WMI 5.1 to get PowerShell 5, fool I was.

1 vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)

    We’ll send you updates on this idea

    mupan shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    5 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • mupan commented  ·   ·  Flag as inappropriate

        I'd love ideas to circumvent that PS v5 bug with PS v5 installed and used, or information about e.g. security considerations, if that denial of service by powershell v5 should be on purpose, for me to understand.

      • mupan commented  ·   ·  Flag as inappropriate

        Re-installing PS v4 was successful, so, giving up PS v5 fixed my problem for now. I guess that means that I cannot upgrade to Windows 8.1 because v5 is the bundled version and I cannot deinstall it!? I spent some time modernizing my script by using Invoke-Webrequest with session id rather than the COM IE automation, but that seems not to work with our ****** ticket system. So I have to wait until our ticket system migration has been accomplished finally, until I install a higher Windows? We are talking about years, not months or weeks.

      • mupan commented  ·   ·  Flag as inappropriate

        Deinstalling PS / WMF v5 left powershell in a corrupt state, powershell.exe won't start. I am somewhere in the middle between v3 and v4 now. Reinstalling WMF v4 requires deinstalling it. My next reboot possibility will be in about an hour I hope. Stay tuned to read the end of this drama. Maybe the end will be a fresh install of Windows?

      Feedback and Knowledge Base