function downloadFile{ param( $url, $tempFolder="C:\Temp" ) try{ $fileName=split-path $url -leaf $tempFile = "$tempFolder\$fileName" try{[Net.ServicePointManager]::SecurityProtocol =…