Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Oracle JDK7 Download Install powershell
$url = 'http://download.oracle.com/otn-pub/java/jdk/7u60-b19/jdk-7u60-windows-x64.exe'
$filename = $url.Substring($url.LastIndexOf("/") + 1);
$client = new-object System.Net.WebClient;
$client.Headers.Add("Cookie", "oraclelicense=accept-securebackup-cookie");
$client.DownloadFile( $url, $filename );
$result = (Start-Process -FilePath $filename -ArgumentList "/quiet /qn /norestart /l* jdk7_install.log" -Wait -Passthru).ExitCode;
echo $result;
Get-WmiObject -Class Win32_Product -Filter "Name LIKE '%java%SE Development Kit 7%'";
# IdentifyingNumber : {64A3A4F4-B792-11D6-A78A-00B0D0170600}
# Name : Java SE Development Kit 7 Update 60 (64-bit)
# Vendor : Oracle
# Version : 1.7.0.600
# Caption : Java SE Development Kit 7 Update 60 (64-bit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment