Created
March 4, 2019 06:52
-
-
Save mark05e/9208c92bfc1e18eb293d38749e2853b7 to your computer and use it in GitHub Desktop.
To display all installed Java versions using powershell
This file contains hidden or 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
# Reference: https://www.experts-exchange.com/questions/28995393/check-java-version-using-powershell.html | |
'', 'Wow6432Node\' | | |
ForEach-Object {Get-ItemProperty -Path HKLM:\SOFTWARE\$($_)Microsoft\Windows\CurrentVersion\Uninstall\* | | |
Where-Object {($_.DisplayName -like '*Java *') -and (-not $_.SystemComponent)} | | |
Select-Object DisplayName, DisplayVersion, InstallLocation, @{n='Architecture'; e={If ($_.PSParentPath -like '*Wow6432Node*') {'x86'} Else {'x64'}}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
haw do i use it ?