# Capture an SSH shell transcript

Capture an SSH shell transcript 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**18**

Open issues**0**

PowerShell Gallery downloads**14067470**

Release**v2.0.4**

Language: C# Updated: 2026-11-23

Curated Examples

Use Transferetto to retain and export a transcript from an interactive SSH shell.

This pattern is useful when you want to keep a readable record of what happened during an interactive shell workflow, especially for deployment or server troubleshooting.

It is adapted from the source example at `Examples/Example26-SSHShellTranscript.ps1`.

## When to use this pattern

- An automation runs several shell commands in sequence.
- You want to review the shell dialogue after the fact.
- The workflow should persist a transcript to disk for logs or investigation.

## Example

```powershell
Import-Module Transferetto

$sshClient = Connect-SSH -Server 'server.example.com' -Credential (Get-Credential)
$shell = New-SSHShell -SshClient $sshClient -PromptPattern '(?m)^[^@\r\n]+@[^:\r\n]+:.*[$#]\s?$'

Invoke-SSHShellCommand -ShellSession $shell -Command 'cd /var/www/html && ls -la'
Invoke-SSHShellCommand -ShellSession $shell -Command 'sudo systemctl status nginx --no-pager'

Get-SSHShellTranscript -ShellSession $shell -AsText
Export-SSHShellTranscript -ShellSession $shell -Path "$PSScriptRoot\Logs\ssh-session.log"

Close-SSHShell -ShellSession $shell
Disconnect-SSH -SshClient $sshClient
```

## What this demonstrates

- running multiple commands through one shell session
- reading the accumulated transcript in text form
- exporting the transcript for later review

## Source

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

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