none
Powershell script to uninstall java and install Java

    Question

  • I have a script to unistall all versions of java and install new version, it run good on my local machine.

    but when in run it on remote computer it uninstalls java but not install it.

    I am using batch file to run the script with command

    powershell.exe  -Executionpolicy bypass -file "%~dp0test.ps1" 

    am I missing anything

    Thanks

    $Type = "Java*"
    
    $Prod = Get-WMIObject Win32_Product | Where {$_.Name -like $type}
    
    If($Prod)
    {   
        #Uninstall based on MSI code 
        ForEach($App in $Prod)
        {
         msiexec.exe /x $App.IdentifyingNumber /qn
        }
    
    }
    start-process msiexec -wait -argumentlist '/i jre1.8.0_181.msi INSTALL_SILENT=1 AUTO_UPDATE=0 WEB_JAVA=1 WEB_JAVA_SECURITY_LEVEL=H /q' | Out-Null 


    EDGE

    Wednesday, August 1, 2018 5:06 PM

Answers