Skip to content

Instantly share code, notes, and snippets.

@PSingletary
Created December 18, 2017 12:40
Show Gist options
  • Save PSingletary/bbda0ced3cbecf07f776d94dd213be4d to your computer and use it in GitHub Desktop.
Save PSingletary/bbda0ced3cbecf07f776d94dd213be4d to your computer and use it in GitHub Desktop.
PowerShell oneliner to list all the installed .NET versions on a local computer - http://www.happysysadm.com/2017/12/powershell-oneliner-to-list-all.html
<#
.SYNOPSIS
<A brief description of the function or script. This keyword can be used only once in each topic.>
.DESCRIPTION
<A detailed description of the function or script. This keyword can be used only once in each topic.>
.LINK
http://www.happysysadm.com/2017/12/powershell-oneliner-to-list-all.html
#>
((ls 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -rec|? {$_.name -match 'v1.1.4322$|v2.0.50727$|v3.0$|v3.5$|v4\\Full$'} | select -expand name) -replace 'HKEY_LOCAL_MACHINE','HKLM:') -replace 'HKEY_LOCAL_MACHINE','HKLM:'|%{ Get-ItemProperty $_} | select -expand Version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment