How to Return Versions of .NET Framework on a Machine using PowerShell Script
Microsoft designed and developed the .NET framework, a software development platform. It is used to develop desktop, web-based, and form-based applications.
It consists of multiple programming languages, libraries, and developer tools to develop such applications. We can also use this framework to create web services and games.
.NET framework is installed in the Windows operating system by default. However, the .NET framework version can differ depending on the OS versions.
This tutorial will teach you to check the .NET framework version using different methods in Windows PowerShell.
Use PowerShell Script to Return Versions of .NET Framework on a Machine
In PowerShell, the Get-ItemProperty
cmdlet gets the properties of the specified items. We can also use this cmdlet to view registry entries and their values.
The following command gets the version of the .NET framework from Windows Registry HKLM:Software\Microsoft\NET Framework Setup\NDP\v4\Full
.
(Get-ItemProperty "HKLM:Software\Microsoft\NET Framework Setup\NDP\v4\Full").Version
Output:
4.8.04161
4.8.04161
is the .NET framework version on our computer.
We can use the command below to get more detailed information.
Get-ItemProperty -Name Version, Release "HKLM:Software\Microsoft\NET Framework Setup\NDP\v4\Full"
Output:
Version : 4.8.04161
Release : 528449
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\FULL
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4
PSChildName : FULL
PSDrive : HKLM
PSProvider : Microsoft.PowerShell.Core\Registry
We hope this article helped you understand how to check the .NET framework version in PowerShell.