Uninstall the old version of Java and then install the new version. The script identifies the x86 and x64 installers thereby making it easy for the admin to drop new installers into the relative directory when needing to update. At that point, update the SCCM content, along with the detection method and it will redeploy.
Write-Host"Failed with error code "$ErrCode-ForegroundColor Red
Exit$ErrCode
}
}
functionUninstall-MSIByName {
<#
.SYNOPSIS
Uninstall-MSIByName
.DESCRIPTION
Uninstalls an MSI application using the MSI file
.PARAMETERApplicationName
Display Name of the application. This can be part of the name or all of it. By using the full name as displayed in Add/Remove programs, there is far less chance the function will find more than one instance.
.PARAMETERSwitches
MSI switches to control the behavior of msiexec.exe when uninstalling the application.