Powershell to Uninstall Java JRE installed in Windows

Powershell to Uninstall Java JREs any version 7s  from windows.

create a text file which lists workstations or servers – eg. computers.txt

$computers=Get-Content “C:computers.txt”
Foreach ($computer in $computers)
{
$java = Get-wmiobject -ComputerName $computer -Filter “name like ‘Java%’ AND version like ‘7%'” | % {$_.Uninstall()}
}