在PowerShell中指定IE文档模式

时间:2015-06-03 03:32:57

标签: powershell

$ie = New-Object -ComObject 'internetExplorer.Application'
$ie.Visible= $true
$ie.Navigate("https://foo.example.com/login")

如何强制IE的这个新实例处于文档模式Edge或10?

默认情况下,它会在文档模式5中加载此站点,有时会加载7。

1 个答案:

答案 0 :(得分:0)

显然,您首先获得$ie.document,然后您应该查询其documentModecompatMode。但是,从Powershell查询$ie.document时,documentMode属性不会公开。获得compatMode是可能的,但设置不是。所以我认为Powershell不可能做到这一点。 (可能是开发人员工具是根据COM对象授权的模式以获得更多属性)