# Give a basic message to the user to let them know what we are doing $FullFilePath = '$($FileDirectory)$($FileName)'įunction Get-FileDownload( $WebURL, $FullFilePath) # Concatenate the two values to prepare the download # We assume the file you download is named what you want it to be on your computer # If directory doesn't exist create the directory $FileDirectory = '$($env:USERPROFILE)$('\downloads\')' This script will download the installer file, create the silent install text file then silently install Java JDK or Java JRE and place the executable path into the System Environment Path. This code is rather useful if you need to install Java JDK or Java JRE without a product like SCCM.