Created
January 12, 2018 15:52
-
-
Save VimalShekar/099b7f08d656fe075edf6a24fed1c578 to your computer and use it in GitHub Desktop.
Check if .NET 3.5 or later is present on the machine in PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-- Get the full script here:https://github.com/VimalShekar/PowerShell/blob/master/CheckDotNet.ps1 | |
Function IsDotNet35orGreater { | |
# Check if .NET version 3.5 or greater is present | |
[bool] $bVersionPresent = $false | |
$Frameworks = Get-ChildItem "HKLM:\Software\Microsoft\NET Framework Setup\NDP" | |
foreach($FWver in $Frameworks) { | |
# if it matches v[0-9].+ and is >= v3.5 then requisite is met | |
if(($FWver.PSChildName -match "v[0-9].+") -and ($FWver.PSChildName -ge "v3.5")) | |
{ | |
$bVersionPresent = $true | |
break | |
} | |
} | |
return $bVersionPresent | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment