# Sync a folder with SFTP

Sync a folder with SFTP on Evotec with practical examples, usage guidance, and reusable project workflows.

Project

Transferetto

Small PowerShell module with FTPS/SFTP functionality

[View on GitHub](https://github.com/EvotecIT/Transferetto) [Visit Website](#) [Releases](https://github.com/EvotecIT/Transferetto/releases/tag/Transferetto-v2.0.0) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/Transferetto)

Stars**93**

Forks**18**

Open issues**0**

PowerShell Gallery downloads**14067470**

Release**v2.0.4**

Language: C# Updated: 2026-11-18

Curated Examples

Use Transferetto to upload or download an entire directory tree over SFTP.

This pattern is useful when a job needs to publish a prepared folder or pull down a full export instead of handling files one by one.

It is adapted from the source example at `Examples/Example23-SFTPDirectoryTransfer.ps1`.

## When to use this pattern

- You need to move a whole directory tree.
- The local and remote root folders are known ahead of time.
- You want Transferetto to return transfer result objects for each item.

## Example

```powershell
Import-Module Transferetto

$credential = Get-Credential
$sftpClient = Connect-SFTP -Server 'sftp.example.com' -Credential $credential

Send-SFTPDirectory -SftpClient $sftpClient `
    -LocalPath "$PSScriptRoot\Upload" `
    -RemotePath '/incoming/releases' `
    -AllowOverride

Receive-SFTPDirectory -SftpClient $sftpClient `
    -RemotePath '/outgoing/reports' `
    -LocalPath "$PSScriptRoot\Download\Reports" `
    -AllowOverride

Disconnect-SFTP -SftpClient $sftpClient
```

## What this demonstrates

- sending a whole local folder into a remote SFTP location
- receiving a remote directory tree into a deterministic local path
- reusing the same SFTP session for both upload and download work

## Source

- [Example23-SFTPDirectoryTransfer.ps1](https://github.com/EvotecIT/Transferetto/blob/master/Examples/Example23-SFTPDirectoryTransfer.ps1)

<!-- PowerForge markdown artifact sha256:ECEBDA97E0788E09C021AA2965A040E11FCF191D8B2F17227E62494BD5507DF2 -->
