gabber4858
Technical User
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.
Thanks in advance!
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!