How to programmatically determine installed IIS version

后端 未结 6 2036
别那么骄傲
别那么骄傲 2021-01-17 20:27

What would the preferred way of programmatically determining which the currently installed version of Microsoft Internet Information Services (IIS) is?

I know that i

6条回答
  •  星月不相逢
    2021-01-17 21:01

    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

提交回复
热议问题