TIL 2016/08/15 .NET Framework Installed Versions Check iex ((new-object net.webclient).DownloadString('RAWGISTURL')) #Similar to Choco/Boxstarter bootstrap curl -Uri <raw_url_of_gist> -OutFile Get-Framework.ps1; .\Get-Framework.ps1
# Get .NET framework versions installed via PowerShell
# http://stackoverflow.com/a/3495491/3794873
Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse |
Get-ItemProperty -name Version,Release -EA 0 |
Where { $_.PSChildName -match '^(?!S)\p{L}'} |
Select PSChildName, Version, Release, @{
name="Product"
expression={
switch -regex ($_.Release) {
"378389" { [Version]"4.5" }
"378675|378758" { [Version]"4.5.1" }
"379893" { [Version]"4.5.2" }
"393295|393297" { [Version]"4.6" }
"394254|394271" { [Version]"4.6.1" }
"394802|394806" { [Version]"4.6.2" }
{$_ -gt 394806} { [Version]"Undocumented 4.6.2 or higher, please update script" }
}
}
}