I'm looking to get the java versions of all the Java on the machine.
Get-ChildItem 'C:\Program Files*' -Include java.exe -Recurse | % { $_ -version }
i'm able to get the results however am not able to run the commands to get the actual versions back.
C:\Program Files\Java\jre1.8.0_241\bin\java.exe -version
C:\Program Files\Vertiv\DSView 4\j2sdk\bin\java.exe -version
C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe -version
C:\Program Files (x86)\Common Files\Oracle\Java\javapath_target_3553135156\java.exe -version
any other options appreciated.