The following script adds a PowerShell Host
var objPowerShellHostConfig; objPowerShellHostConfig = new PowerShellHostConfig(); objPowerShellHostConfig.name = "vco01.vcoflow.co.uk"; objPowerShellHostConfig.type = "WinRM"; objPowerShellHostConfig.connectionURL = "vco01.vcoflow.co.uk"; objPowerShellHostConfig.transportProtocol = "HTTP" objPowerShellHostConfig.port = "5985"; objPowerShellHostConfig.username = "vcoflow@vcoflow.co.uk"; objPowerShellHostConfig.password = "P@ssw0rd1!"; objPowerShellHostConfig.authorizationMode = PowerShellAuthorizationMode.fromString("Shared Session"); objPowerShellHostConfig.authentication = "Kerberos"; try { objPowerShellHostConfig = PowerShellHostManager.update(objPowerShellHostConfig); } catch ( objException ) { System.log ( objException ); }