1

In PowerShell I have:

$ie = New-Object -COM InternetExplorer.Application

How to get the version number of $ie? I want to verify that we are using an instance of IE11 or later, or prompt the user to upgrade their Internet Explorer.

Thanks!

Answer: Building on the accepted answer this is what I used:

$ieVersion = New-Object -TypeName System.Version -ArgumentList (
    Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Internet Explorer').Version
$ieVersion = New-Object -TypeName System.Version -ArgumentList (
    # switch major and minor
    $ieVersion.Minor, $ieVersion.Major, $ieVersion.Build, $ieVersion.Revision)
if ($ieVersion.Major -lt 11)
{
    Write-Error "Internet Explorer 11 or later required. Current IE version is $ieVersion"
    exit
}
0

1 Answer 1

8

Without instantiating an InternetExplore.Application object one could use PowerShell to retrieve the version of IE from the registry. All versions of IE store their version in the same place. This should work:

 (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Internet Explorer').Version

In order to make sense of the Internet Explorer version numbers Microsoft provides a table. In particular IE11 is:

Internet Explorer 11 will have a version number that starts with 11 (for example, 11.0.9600). The version number will change based on the updates that have been installed for Internet Explorer. To see the version number and the most recent update installed, go to the Help menu and select About Internet Explorer.

Special Note: For IE 10+:

The version number returned by Version will appear as <version minor>.<version major>... . The true version that gets displayed is now stored in SvcVersion. One could create a Powershell Script that queries SvcVersion (instead of Version) and if it returns non blank use it. Otherwise one should query Version as above.

Sign up to request clarification or add additional context in comments.

1 Comment

Very true, I amended the answer to provide that simplification.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.