# Download files with SFTP

Download files 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**94**

Forks**17**

Open issues**0**

PowerShell Gallery downloads**14067470**

Release**v2.0.4**

Language: C# Updated: 2026-11-23

Curated Examples

Use Transferetto to download selected files from a remote SFTP folder.

This pattern is useful when a process needs to collect exported files from a partner or internal SFTP endpoint.

It is adapted from the source example at `Examples/Example12-Receive-SFTPFile.ps1`.

## When to use this pattern

- You need to download each file from a remote folder.
- The local landing folder is controlled by the script.
- You want a status object for each transfer.

## Example

```powershell
Import-Module Transferetto

$credential = Get-Credential
$sftpClient = Connect-SFTP -Server 'sftp.example.com' -Credential $credential
$localFolder = Join-Path $PSScriptRoot 'Output\SftpDownload'

New-Item -ItemType Directory -Force -Path $localFolder | Out-Null

$remoteFiles = Get-SFTPList -SftpClient $sftpClient -Path '/pub/example' |
    Where-Object { -not $_.IsDirectory }

$output = foreach ($remoteFile in $remoteFiles) {
    $localPath = Join-Path $localFolder $remoteFile.Name
    Receive-SFTPFile -SftpClient $sftpClient -RemotePath $remoteFile.FullName -LocalPath $localPath
}

$output | Format-Table
Disconnect-SFTP -SftpClient $sftpClient
```

## What this demonstrates

- filtering remote folder entries to files
- downloading into a deterministic local folder
- returning transfer status objects for review

## Source

- [Example12-Receive-SFTPFile.ps1](https://github.com/EvotecIT/Transferetto/blob/master/Examples/Example12-Receive-SFTPFile.ps1)

<!-- PowerForge markdown artifact sha256:897CE99FA67C104EC794694C36A70D022C4335384301B5E24D015BC74CFBEF99 -->
