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 Update a PowerShell Host
Function: PowerShellHostUpdate
public PowerShellHostUpdate(objPowerShellHost: PowerShellHost, strName: string, strFQDN: string, strUsername: string, strPassword: string): PowerShellHost {
// @ts-ignore
// let objPowerShellShellCodePage: PowerShellShellCodePage = PowerShellShellCodePage.fromString(strCodePage);
// @ts-ignore
let objPowerShellHostConfig: PowerShellHostConfig = new PowerShellHostConfig();
objPowerShellHostConfig.name = strName;
objPowerShellHostConfig.type = "WinRM";
objPowerShellHostConfig.connectionURL = strFQDN;
objPowerShellHostConfig.transportProtocol = "HTTPS"
objPowerShellHostConfig.port = "5985";
objPowerShellHostConfig.username = strUsername;
objPowerShellHostConfig.password = strPassword;
objPowerShellHostConfig.authentication = "Kerberos";
// objPowerShellHostConfig.setShellCodePage(objPowerShellShellCodePage); // Found in code but not in documentation
// objPowerShellHostConfig.setIdleTimeout(intIdleTimeout); // Found in code but not in documentation
// objPowerShellHostConfig.setReadTimeout(intReadTimeout); // Found in code but not in documentation
// @ts-ignore
objPowerShellHostConfig.authorizationMode = PowerShellAuthorizationMode["Shared Session"];
objPowerShellHost = PowerShellHostManager.update(objPowerShellHostConfig);
return objPowerShellHost;
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
