Skip to content

Powershell

Robinicks edited this page Feb 3, 2020 · 2 revisions

Use FluentFTP from Powershell

You can use FluentFTP to transfer files to your FTP servers from your Powershell scripts. To get started:

  1. Download all the files in the Powershell folder in this repo.
  2. Place the contents into C:\Scripts or any folder of your choice.
  3. Run this in Powershell to make the FluentFTP functions usable:
>. C:\Scripts\FluentFTP.ps1   #Makes functions callable from PowerShell scripts
  1. Run the commands you need! (Example commands are given below)
> Show-FtpFile -Site ftp.mysite.com -User bob -Password secure -FtpDirectory pub -FtpFileName "text*"
> Rename-File -Site ftp.mysite.com -User bob -Password secure -FtpDirectory pub -oldName "Readme.txt -newName Readme.done"
> Send-FtpFile -Site ftp.mysite.com -User bob -Password secure -FtpDirectory pub -fileName "Read*"
> Get-FtpFile -Site ftp.mysite.com -User bob -Password secure -FtpDirectory pub -ftpfileName "Read*"
> Remove-FtpFile -Site ftp.mysite.com -User bob -Password secure -FtpDirectory pub -ftpfileName "Read*"

Help on each command can be printed by running these commands in Powershell:

> get-help -full Show-FtpFile
> get-help -full Rename-FtpFile
> get-help -full Send-FtpFile
> get-help -full Get-FtpFile
> get-help -full Remove-FtpFile
Clone this wiki locally