How to properly close Internet Explorer when launched from PowerShell?

后端 未结 6 1925
长情又很酷
长情又很酷 2020-12-06 06:43

There was a set of recently asked questions about doing something with Internet Explorer via PowerShell. All of them contain codes to launch IE from PowerShell as an object,

6条回答
  •  盖世英雄少女心
    2020-12-06 07:29

    I've had similar problems with COM objects that wouldn't terminate using the quit() method. Interopservices.marshall also doesn't work a lot of times. My workaround : I do a get-process to get a list of all procs before I call the com object and right after : this way I have the PID of my instance. After my script runs it kills the process using stop-process.

    Not the best way to do this but at least it works

提交回复
热议问题