AutomoxAutomox

Worklet to remove all java versions

Maikel
November 17, 2020 at 2:40 pm UTC

Simple worklet to remove all java versions and write back in activity log. Worklet is maintained on our github page: https://github.com/Dutch-Technology-eXperts/Automox/blob/main/remove_java.ps1

Evaluation code:

1 line
Exit 1

Remediation code:

powershell9 lines
IF (gwmi Win32_Product -filter "name like 'Java%'")
{
[void](gwmi Win32_Product -filter "name like 'Java%'" | % { $_.Uninstall() })

if ($? -eq "True")
{ Write-Output "Java succesfully removed." }
else {Write-Output "Failed to remove Java!" }
}
ELSE {Write-Output "Java not installed."}

This discussion is archived and closed to replies. Continue it in the Automox Community Slack.

Discuss on Slack