Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
$ie = New-Object -com internetexplorer.application
我想在脚本下次运行时重用这个对象。我不想创建一个新对象
您应该能够使用此方法附加到进程,检查 Windows() 方法的结果,找到 IE,然后构建正确的 where 子句:
$ie = (New-Object -ComObject Shell.Application).Windows() | Where-Object {...}