Download a file using PowerShell
Today, we are going to use Windows PowerShell to download a file from the Internet with the help of simple commands. Follow on to the below steps to know how to do so:
Open PowerShell console as an administrator. To do this, press Windows Key on your keyboard and type in powershell. Right-click Windows Powershell (Desktop App) and select Run as administrator. Select Yes in the UAC window that pops up.
Now, you need to copy the link of the file you want to download using PowerShell. See the below image for example:
Copy and paste the following command in Notepad.
Now, in the above command, replace Download Link with the link you copied in Step 2. Insert the download location path along with the name you want to save the file with, along with its extension in place of File Destination\file name.file extension. DO NOT remove the double-quotes. See the below example for the modifying the command:
Now, copy the modified command and paste it into the PowerShell window. Hit Enter to download the file.
That’s it! You can navigate to the download folder path to find your file stored there.
If downloading any file requires you to enter credentials of some sort like server login details etc., then you can use the following command to download the file in one shot: Let us know in the comments section below if you are facing any issue while trying to download the file.