PowerShell FTP Client Module

The PSFTP module allow you to connect and manage the contents of ftp account. Module contain set of function to get list of items, download and send files on ftp location.

PSFTP.zip
 
 
 
 
 
4.5 Star
(106)
48,095 times
Add to favorites
Applications
1/12/2019
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • -Overwrite:$false not working
    1 Posts | Last post July 07, 2019
    • I am unable to get the -Overwrite:$false parameter to work. If I set it to $true then it works and it overwrites every time but what I would like to do is to skip any files that already exist.
      
      Anyone have any clues?
      
      Thanks.
  • TLS 1.2 connections not working
    1 Posts | Last post June 25, 2019
    • If the FTP server is forcing TLS1.2, this module can't connect.
      
      The fix is to install .NET framework 4.61 or up and add these reference types..
      
      Add-Type -Path "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Net.dll"
      Add-Type -Path "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\Facades\System.Net.Requests.dll"
  • Remove-FTPItem failed
    1 Posts | Last post May 22, 2019
    • FTP server: xx.xx.xx.xx
      
      script:
      Remove_FTPItem -Path $Path -Session $Session
      "--> $Path"
      
      script output:
      --> /myname/xxx.txt
      ->Remove File: ftp://xx.xx.xx.xx/myname/xxx.txt
      
      Exception 550 file is not available(file not found or can't access file)
  • efficiency problem
    1 Posts | Last post May 17, 2019
    • I tried using Get-FTPChildItem to download file from FTP server, but it didn't work well, it spend several minutes while getting a 37 KB pdf file. 
  • efficiency problem
    1 Posts | Last post May 17, 2019
    • I tried using Get-FTPChildItem to download file from FTP server, but it didn't work well, it spend several minutes while getting a 37 KB pdf file. 
  • Works on Windows 10 but not 2008 R2
    2 Posts | Last post May 09, 2019
    • I placed the modules in the system dir, and found them no problem.  Ran it on my Windows 10 v 1709 machine, ran flawlessly, progress bar scrolls nicely, downloads and deletes as expected.  I'm a local admin on the machine.  The machine I'm not having any luck on is a Windows 2008 R2 DC.  I'm signed in as the administrator and have tried running it both with and without admin rights.
      
      $FtpServer = "ftp://xxx.xxx.xxx.xxx"
      $User = "xxxx"
      $PWD = "xxxx"
      $Password =  ConvertTo-SecureString $Pwd -AsPlainText -Force
      $FtpCredentials = New-Object System.Management.Automation.PSCredential ($User, $Password)
      Set-FTPConnection -Credentials $FtpCredentials -Server $FtpServer -Session MyFtpSession -UsePassive
      $FtpSession = Get-FTPConnection -Session MyFtpSession
      $ServerPath = "/wp-content/custom/applications/"
      $LocalPath  = "x:\mylocaldir\"
      $fileList   = Get-FTPChildItem -Session $FtpSession -Path $ServerPath -Filter application*.html
      foreach ($element in $fileList ) {
       $filename = $ServerPath  + $element.name
       Get-FTPItem    -Path $filename -Session $FtpSession -LocalPath $LocalPath -Overwrite $true
          Remove-FTPItem -Path $filename -Session $FtpSession
          }
      
      The result is I get:
      
      Set-FTPConnection : Exception calling "GetResponse" with "0" argument(s): "The remote server returned an error: (530) Not logged in."
      
      At C:\Users\Administrator\Downloads\test_dl.ps1:6 char:18
      + Set-FTPConnection <<<<  -Credentials $FtpCredentials -Server $FtpServer -Session MyFtpSession -UsePassive
          + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
          + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Set-FTPConnection
      
      1/2 
    • Try adding the sleep 2 between your foreach loop items, that did the trick for me :D
  • Problem with Get-FTPItem
    1 Posts | Last post April 11, 2019
    • when i use $ftp= Get-FTPChildItem -Session $Session -Recurse
      i have see 
      Parent: ftp://ftp.host.ru
      
      Dir Right     Ln  User   Group  Size   ModifiedDate        Name                                                                                                          
      --- -----     --  ----   -----  ----   ------------        ----                                                                                                          
      -                               B                                                                                                                                        
      -                               B                                                                                                                                        
      -                               B                                                                                                                                        
      -                               B                                                                                                                                        
                                                                                                                                     
      that means, no file-objects are read, only "B" for size, nothing else.
      HELP ME please
                       
  • OS Compatibility
    1 Posts | Last post April 05, 2019
    • I am running into issue when trying to use Get-ChildItem. Specifically, a 550 Error ">> TerminatingError(Add-FTPItem): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Exception calling "GetResponse" with "0" argument(s): "The remote server returned an error: (550) File unavailable (e.g., file not found, no access).""
      
      Is this compatible with Server 2016?
      
      
  • "Value cannot be null" Message
    1 Posts | Last post March 18, 2019
    • we can successfully create directories using:
      
             Get-ChildItem $testfile | Add-FTPItem -Session $Session -Path /TestRootDir 
      
      and observe these directories using:
      
             Get-FTPChildItem -Session $Session -Path /TestRootDir -Recurse -Depth 2 
      
      but when trying to create a file it fails:
      
             Add-FTPItem -Session $Session -Path /TestRootDir -LocalPath TestFile.txt
      
      we get error:
      Exception setting "Credentials": "Value cannot be null.
      Parameter name: value"
      At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSFTP\Add-FTPItem.ps1:150 char:9
      + ...                    $Request.Credentials = $CurrentSession.Credentials
      +                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [], SetValueInvocationException
          + FullyQualifiedErrorId : ExceptionWhenSetting
       
      Add-FTPItem : Exception calling "GetRequestStream" with "0" argument(s): "The remote server returned an error: (534) 534 Policy requires SSL.
      ."
      At C:\Users\mazw\Desktop\powershell\test ftp\Untitled2.ps1:67 char:1
      + Add-FTPItem -Session $Session -Path /TestRootDir -LocalPath TestFile. ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
          + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Add-FTPItem
      
      
      is this a known bug please?
      regards
      Marc
  • "Exception setting "Credentials": "Value cannot be null." error
    1 Posts | Last post December 01, 2018
    • Import-Module PSFTP
      $username = "xxx"
      $pass = "xxx"
      $password = $pass | ConvertTo-SecureString -asPlainText -Force
      $credentials = New-Object System.Management.Automation.PSCredential($username, $password)
      $file = "C:\xxx\xxx\test.txt"
      Set-FTPConnection -Credentials $credentials -Server ftp://ftp.xxx.com -Session FTPSession -Usepassive
      $Session = Get-FTPConnection -Session FTPSession 
      Add-FTPItem  -path /invoices -Session $Session -LocalPath $file
      
      I get this error after running the script above:
      
      Exception setting "Credentials": "Value cannot be null.
      Parameter name: value"
      At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSFTP\Add-FTPItem.ps1:150 char:9
      + ...                    $Request.Credentials = $CurrentSession.Credentials
      +                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [], SetValueInvocationException
          + FullyQualifiedErrorId : ExceptionWhenSetting
      
      All other functions work, except Add-FTPItem. Anybody came across this? 
      
1 - 10 of 178 Items