PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Forum experts available to answer your PowerShell questions

Passing arguments into FTP script via Powershell?

rated by 0 users
Not Answered This post has 0 verified answers | 2 Replies | 2 Followers

Not Ranked
5 Posts
lmjones1uk posted on 11-25-2009 3:26 AM

Hello,

 

I’m having a few difficulties trying to pass arguments into a ftp script via Powershell and I hope some of you guys may be able to help me out.

 

From a powershell script I’m invoking an FTP script with the following command:

 

    ftp '-s:FTP.txt'

 

The FTP script is below and works fine if I call it from DOS.

 

    open <IP ADDRESS HERE>

    %1

    %2

    cd <DIRECTORY TO DESTINATION >

    lcd <DIRECTORY TO SOURCE >

    put %3

    bye

 

(%1 = username, %2 = password, %3 = file)

 

I know how to pass arguments to a normal .bat file but because of the way powershell calls an FTP script it wont work L Now I’ve looked high and low for a solution and I don’t want to do anything querky such as create the FTP script and run within the script inclusive of the parameters.

 

Any help would be much appreciated!

 

Kind regards,

Liam

Page 1 of 1 (3 items) | RSS
Copyright 2012 PowerShell.com. All rights reserved.