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
publicSSHHostAdd(strHostFQDN:string,strUsername:string,strPassword?:string,strPassPhrase?:string,strCertificatePath?:string,arrRootFolder?:string[],blnPasswordAuthentication:boolean=true,intPort:number=22):SSHHost{
letobjSSHHostConfiguration:SSHHostConfiguration=newSSHHostConfiguration();
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;
}
letobjSSHHost:SSHHost=SSHHostManager.addSshHost(objSSHHostConfiguration);
returnobjSSHHost;
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
