Project

Transferetto

Small PowerShell module with FTPS/SFTP functionality

Stars64
Forks15
Open issues10
PowerShell Gallery downloads12892266
Releasev1.0.0
Language: PowerShell Updated: 2026-02-14T21:19:42.0000000+00:00

Curated Examples

Run Linux commands with SSH

Use Transferetto to send one-shot Linux commands over SSH from PowerShell.

This pattern is useful when PowerShell should ask a Linux host for status or run a short sequence of commands without opening a longer interactive session.

It is adapted from the source example at Examples/Example08-ConnectSSH.ps1.

When to use this pattern

  • A few commands should run in order over SSH.
  • You do not need prompt-aware shell automation yet.
  • The result can be returned as command output directly.

Example

Import-Module Transferetto

$sshClient = Connect-SSH -Server 'server.example.com' -Credential (Get-Credential)

$command = {
    'cd /var/www/html'
    'ls -la'
    'cat /etc/os-release'
}

Send-SSHCommand -SshClient $sshClient -Command $command
Disconnect-SSH -SshClient $sshClient

What this demonstrates

  • opening an SSH session from PowerShell
  • sending multiple Linux commands as one scripted block
  • returning command output without managing an interactive shell

Source