Check .NET versions installed


There are several ways to find out which versions of .NET are installed on your system or on a server.  Below are a few Powershell commands Ive been using.

<#
Version                 Minimum value of the Release DWORD
.NET Framework 4.5         378389
.NET Framework 4.5.1     378675
.NET Framework 4.5.2     379893
.NET Framework 4.6         93295
.NET Framework 4.6.1     394254
.NET Framework 4.6.2     394802
.NET Framework 4.7         460798
.NET Framework 4.7.1     461308
#>


#-- Find out if specific version of.NET Framework installed
Get-ChildItem "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\" | Get-ItemPropertyValue -Name Release | ForEach-Object { $_ -ge 378389 }




# -- Check for .NET Core 2.0
$software = "Microsoft .NET Core Runtime - 2.0.0 (x64)";
$installed = (Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Where { $_.DisplayName -eq $software }) -ne $null

If(-Not $installed) {
 Write-Host "'$software' NOT is installed.";
} else {
 Write-Host "'$software' is installed."
}

 




No comments:

Post a Comment

Add appsettings.json to .NET 6 Console App

  When you start a new .NET 6 Console app, you will have little more than what you see here.   If one wants to use the json configuration fi...