Thursday, August 20, 2015

Checking the version of the .NET Framework installed on your machine

If you are unsure of the version of the .NET Framework that is installed on your machine, you can find that out by looking at your registry as is outlined in this article: https://msdn.microsoft.com/en-us/library/hh925568%28v=vs.110%29.aspx

You can then compare the Release version in your Windows Registry with the versions outlined in the MSDN article to determine the exact version of the .NET Framework you are running on your machine.

To make this process easier, I have created a very convenient PowerShell script which will tell you the .NET Framework Release version immediately:

$NETFrameworkRegKey = "hklm:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full"

$FrameworkReleaseVersion = Get-ItemProperty -Path $NETFrameworkRegKey -Name "Release"

 

 

Clear-Host

Write-Host $NETFrameworkRegKey

Write-Host $FrameworkReleaseVersion.Release

 

switch ($FrameworkReleaseVersion.Release) 

{ 

    378389 {".NET Framework 4.5"} 

    378675 {".NET Framework 4.5.1"} 

    378758 {".NET Framework 4.5.1"} 

    379893 {".NET Framework 4.5.2"} 

    393295 {".NET Framework 4.6"} 

    393297 {".NET Framework 4.6"} 

    default {"The .NET Framework Version could not be determined."}

No comments:

Post a Comment