Downloading jdk using powershell

Question:

I am trying to download the java jdk using powershell scripting as given in the link below

http://poshcode.org/4224

. Here as the author has specified , if I Change the source url where the latest jdk is present
i.e.,

http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-windows-x64.exe

the content is not getting loaded , only about 6KB gets downloaded . I have a doubt , whether the download limit in powershell script is only 6KB?

Here is the code :

Answer:

On inspecting the session on oracle site the following cookie catches attention: oraclelicense=accept-securebackup-cookie. With that in mind you can run the following code:

Source:

Downloading jdk using powershell by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply