$ie = New-Object -ComObject 'internetExplorer.Application'
$ie.Visible= $true
$ie.Navigate("https://foo.example.com/login")
如何强制IE的这个新实例处于文档模式Edge或10?
默认情况下,它会在文档模式5中加载此站点,有时会加载7。
答案 0 :(得分:0)
显然,您首先获得$ie.document
,然后您应该查询其documentMode
和compatMode
。但是,从Powershell查询$ie.document
时,documentMode
属性不会公开。获得compatMode
是可能的,但设置不是。所以我认为Powershell不可能做到这一点。 (可能是开发人员工具是根据COM对象授权的模式以获得更多属性)