While everyday users typically don’t need to worry about which .NET Framework versions are installed on their devices, some applications require specific releases to install and function correctly. Additionally, developers often need to work with multiple versions of the development platform to build and test their applications. Consequently, knowing the installed .NET version on a computer can be beneficial in many different scenarios.
I recently needed to check and ensure that the correct .NET Framework versions were installed in the pre-production BizTalk Server 2020 environment.
Of course, you can achieve this goal in many ways:
- By accessing the Registry to determine which versions are installed
- By using a reg query in the Command Prompt
- or, my favorite, to use a simple PowerShell script to query this information for you.
To achieve this goal, you can use the following PowerShell script:
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
The output will be something like this:
Download
THIS POWERSHELL SCRIPT IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND.
You can download the PowerShell script to identify which .NET Framework versions are installed from GitHub here:
I hope you find this helpful! If you liked the content or found it useful and want to help me write more, you can help us buy a Star Wars Lego for my son!