Created
December 3, 2019 15:17
-
-
Save stesee/1e4583536cb9b76ec97386325382b476 to your computer and use it in GitHub Desktop.
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
$Lookup = @{ | |
378389 = [version]'4.5' | |
378675 = [version]'4.5.1' | |
378758 = [version]'4.5.1' | |
379893 = [version]'4.5.2' | |
393295 = [version]'4.6' | |
393297 = [version]'4.6' | |
394254 = [version]'4.6.1' | |
394271 = [version]'4.6.1' | |
394802 = [version]'4.6.2' | |
394806 = [version]'4.6.2' | |
460798 = [version]'4.7' | |
460805 = [version]'4.7' | |
461308 = [version]'4.7.1' | |
461310 = [version]'4.7.1' | |
461808 = [version]'4.7.2' | |
461814 = [version]'4.7.2' | |
528040 = [version]'4.8' | |
528049 = [version]'4.8' | |
} | |
# For One True framework (latest .NET 4x), change the Where-Oject match | |
# to PSChildName -eq "Full": | |
Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -Recurse | | |
Get-ItemProperty -name Version, Release -EA 0 | | |
Where-Object { $_.PSChildName -match '^(?!S)\p{L}'} | | |
Select-Object @{name = ".NET Framework"; expression = {$_.PSChildName}}, | |
@{name = "Product"; expression = {$Lookup[$_.Release]}}, | |
Version, Release |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
inspired by https://stackoverflow.com/questions/3487265/powershell-script-to-return-versions-of-net-framework-on-a-machine