PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,859 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am looking for a script that can uninstall Java JDK and JRE from the system but should not uninstall OpenJDK
Hi TechUST,
Please try the following command to uninstall JDK.
Get-CimInstance -ClassName Win32_Product -Filter "name like 'Java%' AND vendor like 'Oracle%'" | Invoke-CimMethod -MethodName Uninstall
Best Regards,
Ian Xue
If the Answer is helpful, please click "Accept Answer" and upvote it.