Define the
file you’d like to download and where to save:
$ftpfile = "ftp://ftp.adobe.com/pub/adobe/reader/win/10.x/10.1.2/en_US/AdbeRdr1012_en_US.exe"
$localfile =
"C:\temp\AdbeRdr1012_en_US.exe"
Create new-objects.
Click on the corresponding links to get information about “system.net.webclient”
and “system.uri”
$ftpclient = New-Object system.Net.WebClient
$uri = New-Object System.Uri($ftpfile)
And finally,
download the file:
$ftpclient.DownloadFile($uri,$localfile)
Thank you so much! THis helped me a lot!
ReplyDeleteAwesome, much simpler than other code snippets I've found on the interwebs.
ReplyDeleteNice!
ReplyDelete