Function: Execute an SSH Command

by Simon Sparks · 4 February 2026

To use this function add it to the class library file named PluginSSHService.ts

GitHub Repository: https://github.com/SimonSparksUK/Orchestrator

Filename: PluginSSHService.ts

Description: Orchestrator Function to execute an SSH Command

Public Function: executeSSHCommand

public executeSSHCommand(strSSHHostID: string, strUsername: string, strPassword: string, strSSHCommand: string, blnWait: boolean = true): void {
    let objSSHHost: SSHHost = SSHHostManager.getSshHost(strSSHHostID);

    let objSSHSession: SSHSession = new SSHSession(objSSHHost.hostname, strUsername, objSSHHost.port)

    objSSHSession.connectWithPassword(strPassword);

    objSSHSession.setEncoding("UTF-8");

    objSSHSession.executeCommand(strSSHCommand, blnWait);

    objSSHSession.disconnect();
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like