To use this function add it to the class library file named OrchestratorService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: OrchestratorService.ts
Description: Orchestrator Function to execute an SSH Command
Public Function: executeSSHCommand
publicexecuteSSHCommand(strSSHHostID:string,strUsername:string,strPassword:string,strSSHCommand:string,blnWait:boolean=true):void{
letobjSSHHost:SSHHost=SSHHostManager.getSshHost(strSSHHostID);
letobjSSHSession:SSHSession=newSSHSession(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.
