Hey guys. I’m trying to write a script to automate downloading and installing a list of programs from the internet. I’m somewhat familiar with the different methods to download files such as System.Net.WebClient and Invoke-WebRequest. However, when I download the program, it downloads to my designated directory but not as an exe file. The program I’m working on first is Adobe Acrobat Reader from the official adobe download site. Any ideas what I’m doing wrong?
I will have access to my script later tonight to post.
edit: Here’s my script.
# Download and Run program $uri = "https://get.adobe.com/reader/download/installer=Reader_DC_2017.012.20093_English_for_Windows&os=Windows%2010&browser_type=KHTML&browser_dist=Chrome&d=McAfee_Security_Scan_Plus_Chrome_Browser&dualoffer=false&mdualoffer=false&stype=6685" $out = "c:usersajdocumentsadobeinstaller.exe" Invoke-WebRequest -Uri $uri -Outfile $out & $out
submitted by /u/silver5pectre
[link] [comments]
The post Exe files not downloading as exe. appeared first on How to Code .NET.