Function: SSH Host Add

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 Add an SSH Host

Public Function: SSHHostAdd

public SSHHostAdd(strHostFQDN: string, strUsername: string, strPassword?: string, strPassPhrase?: string, strCertificatePath?: string, arrRootFolder?: string[], blnPasswordAuthentication: boolean = true, intPort: number = 22): SSHHost {
    let objSSHHostConfiguration: SSHHostConfiguration = new SSHHostConfiguration();
    objSSHHostConfiguration.hostname = strHostFQDN;
    objSSHHostConfiguration.port = intPort;
    objSSHHostConfiguration.username = strUsername;
    objSSHHostConfiguration.rootFolders = arrRootFolder;
    objSSHHostConfiguration.passwordAuthentication = blnPasswordAuthentication;

    if (blnPasswordAuthentication) {
        objSSHHostConfiguration.password = strPassword;
    } else {
        objSSHHostConfiguration.passphrase = strPassPhrase;
        objSSHHostConfiguration.certificatePath = strCertificatePath;
    }

    let objSSHHost: SSHHost = SSHHostManager.addSshHost(objSSHHostConfiguration);

    return objSSHHost;
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like