Hey guys, just need some assistance finalising the Java worklet. The automatic patching seems to have uninstalled Java from a fair few machines so need to resolve.
It works fine running from the local machine, however no luck from Automox.
Eval is fine.
It downloads the two files then does not run the commands; installing 2 instances of Java (32 and 64bit).
#Handle Exit Codes:
trap { $host.ui.WriteErrorLine($_.Exception); exit 90 }
try{
$process1 = Start-Process -FilePath 'jre-8u271-windows-i586.exe' -ArgumentList '/s', 'REMOVEOUTOFDATEJRES=1', '/L C:\ProgramData\amagent\worklets\java\java_86.log' -Wait -Passthru -ErrorAction Stop
$process2 = Start-Process -FilePath 'jre-8u271-windows-x64.exe' -ArgumentList '/s', '/L C:\ProgramData\amagent\worklets\java\java_64.log' -Wait -Passthru -ErrorAction Stop
exit 0
}
Catch{
$Exception = $error[0].Exception.Message + "`nAt Line " + $error[0].InvocationInfo.ScriptLineNumber
Write-Output $Exception
exit 90
}
Would appreciate any assistance.