Documentation
Transfer files with PowerShell
Use Transferetto to upload or download files over FTP, FTPS, SFTP, or SCP from PowerShell.
Transferetto gives PowerShell a consistent way to move files across classic FTP, secure file transfer, and SSH-based copy lanes. The main decision is not “can PowerShell do this,” but “which protocol matches the server I am talking to.”
Choose the lane
- Use FTP or FTPS when the remote endpoint is a classic hosting or partner system.
- Use SFTP when you want secure file transfer plus richer remote filesystem operations.
- Use SCP when the server exposes simple SSH copy semantics and you do not need the broader SFTP surface.
Common pattern
Most file-transfer scripts follow the same shape:
- Connect and keep the returned session object.
- Optionally list or inspect the remote path first.
- Upload or download one or more files.
- Disconnect explicitly.
Upload a file with SFTP
Import-Module Transferetto
$sftpClient = Connect-SFTP -Server 'sftp.example.com' -Credential (Get-Credential)
Send-SFTPFile -SftpClient $sftpClient -LocalPath "$PSScriptRoot\Build\artifact.zip" -RemotePath '/incoming/artifact.zip' -AllowOverride
Disconnect-SFTP -SftpClient $sftpClient
Download files with FTP
Import-Module Transferetto
$ftpClient = Connect-FTP -Server 'ftp.example.com' -Credential (Get-Credential)
$files = Get-FTPList -Client $ftpClient -Path '/exports' | Where-Object Type -eq File
Receive-FTPFile -Client $ftpClient -RemoteFile $files -LocalPath "$PSScriptRoot\Download" -LocalExists Overwrite
Disconnect-FTP -Client $ftpClient
Good habits
- Keep credentials outside the script source.
- Decide how overwrite behavior should work before running the transfer.
- Return or review transfer result objects when the job matters operationally.