Clicky

I need to know how to logon onto a FTP Site via a powershell script.  I typlically do it manually with the following command line statements:

FTP x.x.x.x (where x.x.x.x is the IP address) (hit enter)
username (hit enter)
Password (hit enter)

asked 12/11/2011 11:56

JAMES125's gravatar image

JAMES125 ♦♦


4 Answers:
Looks like there are several ways to do this... but this blog looks like a good place to start.
link

answered

Razmus's gravatar image

Razmus

Forgive me if this response is off topic but if you are looking for a way to automate a recurring FTP transaction you could probalby have better luck writing a script to manipulate an existing FTP client rather than rolling your own client with .NET classess in Powershell.

The free DOS command line client that comes with windows might be all that you need if you are connecting to a plain FTP site using an active mode data channel.  Win SCP and WS FTP also have a limited scripting language that you can use for simple tasks.  You could use Robo-FTP if you need something that can do more complicated automation like error handling, automatic retries and so on.
link

answered 2011-12-12 at 08:25:48

AlexPace's gravatar image

AlexPace

I always start with PoshCode: http://poshcode.org/1134
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
$File = "D:Devsomefilename.zip"
$ftp = "ftp://username:password@example.com/pub/incoming/somefilename.zip"
 
"ftp url: $ftp"
 
$webclient = New-Object System.Net.WebClient
$uri = New-Object System.Uri($ftp)
 
"Uploading $File..."
 
$webclient.UploadFile($uri, $File)
link

answered 2011-12-12 at 08:41:00

wls3's gravatar image

wls3

These all seem like viable options, unfortunately I have determined that I need more training before I have the knowledge to impliment them.  That is why I split the points.  Sorry, for the delay.
link

answered 2011-12-12 at 08:46:46

JAMES125's gravatar image

JAMES125

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

Asked: 12/11/2011 11:56

Seen: 120 times

Last updated: 12/15/2011 03:04

Categories

Related questions