Finding Version of IIS using powershell Finding Version of IIS using powershell powershell powershell

Finding Version of IIS using powershell


You can try:

get-itemproperty HKLM:\SOFTWARE\Microsoft\InetStp\  | select setupstring,versionstring 


Even though the thread is little old,this is the link I landed first. So letting you know what I found.

The below command helped me find the IIS version correctly on IIS 8.5 (Windows 2012 R2) and 7.5 Windows 7 SP1.

[System.Diagnostics.FileVersionInfo]::GetVersionInfo("$env:SystemRoot\system32\inetsrv\InetMgr.exe").ProductVersion

Reference:

https://forums.iis.net/p/1171695/1984536.aspx : Answer from f00_beard


If you want the decimal value for order comparison.

$iisInfo = Get-ItemProperty HKLM:\SOFTWARE\Microsoft\InetStp\$version = [decimal]"$($iisInfo.MajorVersion).$($iisInfo.MinorVersion)"