Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with FTP (NON Web)

Status
Not open for further replies.

gabber4858

Technical User
May 27, 2008
95
US
I am trying to get ftp to work from powershell but not sure what needs to be done. Is there a way to get powershell to FTP from the command line (without using a web interface)? I have to ftp some firmware and have made a list of the address and the file that will need to be loaded. My csv file will eventually have upwards of 60 IP addresses that I need to log into. Is there a way to call ftp straight from powershell, and wait for the file to load before logging into the next address? Below makes the output in a similar way that I have had luck with using a .bat and ftp -s. Worst case, I could write this to txt file and do a few at a time.

Code:
$File = "C:\firmware.csv"
$FirmwareUpload = import-csv $File
$User = "randomhero"
$Password = "SomeLamePassword"
 
FOREACH ($Line in $FirmwareUpload)
{
      Write-Host open $Line.IP
      Write-Host $User
      Write-Host $Password
      Write-Host bin
      Write-Host put $Line.firmware
      Write-Host bye
      sleep 5
    }

Thanks in advance!
 
oops...guess thats what preview is for.

Code:
$File = "C:\firmware.csv" 
$FirmwareUpload = import-csv $File 
$User = "randomhero" 
$Password = "SomeLamePassword" 

FOREACH ($Line in $FirmwareUpload) 
{ 
Write-Host open $Line.IP 
Write-Host $User 
Write-Host $Password 
Write-Host bin 
Write-Host put $Line.firmware 
Write-Host bye 
sleep 5 
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top