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

How can I force this new instance of IE to be in document mode Edge or 10?

By default it loads this site in Document mode 5 and sometimes 7.

p.campbell
  • 98,673
  • 67
  • 256
  • 322
  • How do you find the document mode from PowerShell? – Jan Chrbolka Jun 03 '15 at 05:26
  • Apparently you first get `$ie.document` then you should query its `documentMode` and `compatMode`. But, querying `$ie.document` from Powershell the` documentMode` property is not exposed. Getting `compatMode` is possible, but setting isn't. So I think this is not possible from Powershell. (Probably developer tools are mode authorized in terms of COM objects to get more properties) – Vesper Jun 03 '15 at 09:40
  • @JanChrbolka I notice it by seeing how messed up the page renders. F12 dev tools then shows that the mode is IE 7. – p.campbell Jun 03 '15 at 17:13
  • @p.campbell , I see..., I agree with Vesper in that the client side settings and properties are not exposed on the COM object in PowerShell. Also, 99% of all references to IE document mode suggest that this is done on the server side. [How to set IE document mode?](http://stackoverflow.com/questions/17184243/how-to-set-ie-document-mode) – Jan Chrbolka Jun 05 '15 at 00:23

1 Answers1

0

Apparently you first get $ie.document then you should query its documentMode and compatMode. But, querying $ie.document from Powershell thedocumentMode property is not exposed. Getting compatMode is possible, but setting isn't. So I think this is not possible from Powershell. (Probably developer tools are mode authorized in terms of COM objects to get more properties)

Vesper
  • 18,599
  • 6
  • 39
  • 61