Skip to content

Instantly share code, notes, and snippets.

@mark05e
Created March 4, 2019 06:52
Show Gist options
  • Save mark05e/9208c92bfc1e18eb293d38749e2853b7 to your computer and use it in GitHub Desktop.
Save mark05e/9208c92bfc1e18eb293d38749e2853b7 to your computer and use it in GitHub Desktop.
To display all installed Java versions using powershell
# 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'}}}}
@TATS03
Copy link

TATS03 commented Jul 1, 2024

haw do i use it ?

@mark05e
Copy link
Author

mark05e commented Jul 3, 2024

Its been a while but I'd assume you run it by copy pasting the command into powershell. @TATS03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment