Function: SSH Command Execute In Session

by Simon Sparks · 24 March 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 Get a File via SSH

Public Function: executeSSHCommandInSession

public executeSSHCommandInSession(objSSHSession: SSHSession, strSSHCommand: string, blnWait: boolean = true): string {

    let strStdOut: string = objSSHSession.executeCommand(strSSHCommand, blnWait);

    this.objLogger.info("SSH StdOut: " + strStdOut);

    if (objSSHSession.exitCode === 0) {
        this.objLogger.info("SSH Output: " + objSSHSession.output);
    }
    else {
        this.objLogger.info("SSH Error: " + objSSHSession.error);
    }

    return strStdOut;
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like