Hi,
Great, thanks for the reply, it's set me on the right track. A couple of tweaks got it working.
Great, thanks for the reply, it's set me on the right track. A couple of tweaks got it working.
#Remove old versions of 32 bit Java 7
if ((Get-WmiObject -Class Win32_OperatingSystem).OSArchitecture -eq '64-bit') {
$architecture = "64-Bit"
$javaInstalls = Get-InstalledApplication "Java 7 Update"
Foreach ($javaInstall in $javaInstalls) {
$javaInstallLocation = $javaInstall | Select InstallLocation -Expand InstallLocation
$javaProductCode = $javaInstall | Select ProductCode -Expand ProductCode
If ($javaInstallLocation -match "x86") {
Execute-MSI -Action Uninstall -Path $javaProductCode
}
}
} else {
$architecture = "32-Bit"
Remove-MSIApplications "Java 7 Update"
}