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."
}
Subscribe to:
Post Comments (Atom)
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...
-
If you only ever deal with one target machine for your app, life is simple. In the "real world" you often have to deal with multi...
-
Work around databases long enough, sooner or later you or your dba will get asked something to the effect "hey, how many sql databases ...
-
Overview With powershell, you can make a request to a url, parse the results and submit a form. Basically, if you can do it in a browser...
No comments:
Post a Comment