Home ยป PowerShell ยป PowerShell Command to Check .NET Framework Version

PowerShell Command to Check .NET Framework Version

.Net framework is a software development framework developed by Microsoft. It is used for building and running applications and services. Different versions of the .net framework might be installed on the system, it is important to know, how to determine the .net framework version in use.

In this article, we will discuss how to check the .net framework version using a PowerShell command.

The version of the .NET framework installed on a machine is listed in the registry at the location HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\.

For example, to check the .NET framework (4.5 and later) installed on a machine, check the registry location path, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full. If the Full subkey is missing, then .NET framework 4.5 or above is not installed on the system.

There are 2 different ways to determine the .NET framework version using the PowerShell Get-ChildItem and Registry.

  1. Use the Get-ChildItem and Registry to check the .NET framework version.
  2. Use Get-ItemProperty and Registry to check for the minimum version

Using Get-ChildItem and Registry to Check .Net Framework Version

To check the .NET framework version on your system, follow the given steps.

  1. Open up a PowerShell โ€“ Launch the PowerShell terminal
  2. Type the PowerShell command โ€œGet-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -Recurse | Get-ItemProperty -Name version -EA 0 | Where { $_.PSChildName -Match '^(?!S)\p{L}'} | Select PSChildName, versionโ€œ
  3. Hit Enter
  4. This command returns the list of .NET Framework versions installed on your computer.
Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -Recurse | Get-ItemProperty -Name version -EA 0 | Where { $_.PSChildName -Match '^(?!S)\p{L}'} | Select PSChildName, version

In the above PowerShell script, the command Get-ChildItem uses the Registry location to check for the Dot NET framework versions installed on your computer and display Name and version details.

The output of the above PowerShell command to determine the .NET Framework installed on the computer is given below.

PowerShell Command to Check the .NET Framework Version
PowerShell Command to Check the .NET Framework Version

It displays all the .NET framework versions available on the system. The .NET Framework 4.8 is the latest version available and installed on the system.

Cool Tip: How to install the .NET Framework 3.5 using PowerShell!

Using the Get-ItemPropertyValue and Registry to Check for the .Net Framework Version

To check the .NET framework version on your system, follow the given steps.

  1. Open up a PowerShell โ€“ Launch the PowerShell terminal
  2. Type the PowerShell command โ€œ(Get-ItemProperty "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full").Releaseโ€œ
  3. Hit Enter
  4. This command returns the release value that represents the version of the .NET framework installed on your system.
 (Get-ItemProperty "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full").Release

In the above PowerShell script, the Get-ItemProperty command uses the registry location to check for release value. A Release value is a REG_DWORD value that stores the minimum value of the .NET Framework Version.

The output of the above PowerShell script to check the dot net framework version on your computer returns the value of the Release entry as 528040, which is the release key for the .NET framework 4.8 version.

PS C:\> (Get-ItemProperty "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full").Release

528040
PS C:\>                                                                                                                                                

Conclusion

I hope the above article on how to check the .NET Framework version on the computer using the PowerShell command is helpful to you.

Get-ChildItem and Get-ItemProperty cmdlets in PowerShell are used to get the items specified in the Registry location and check the .NET Framework Version.

You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.

Leave a Comment