/// <summary> /// Processes a record. /// </summary> protected override void ProcessRecord() { this.WriteVerbose("Starting a new server connection"); var client = ClientHelpers.GenerateClient(this.Address, this); this.WriteVerbose("Retrieving server version"); var version = client.GetServerVersion(); if (!string.IsNullOrEmpty(this.UserName)) { this.WriteVerbose("Logging in"); var credentials = new List <NameValuePair> { new NameValuePair(LoginRequest.UserNameCredential, this.UserName) }; if (!string.IsNullOrEmpty(this.Password)) { credentials.Add(new NameValuePair(LoginRequest.PasswordCredential, this.Password)); } client.Login(credentials); } var connection = new CCConnection(client, new Version(version)); this.WriteObject(connection); }
/// <summary> /// Processes a record. /// </summary> protected override void ProcessRecord() { this.WriteVerbose("Starting a new server connection"); var client = ClientHelpers.GenerateClient(this.Address, this); this.WriteVerbose("Retrieving server version"); var version = client.GetServerVersion(); if (!string.IsNullOrEmpty(this.UserName)) { this.WriteVerbose("Logging in"); var credentials = new List<NameValuePair> { new NameValuePair(LoginRequest.UserNameCredential, this.UserName) }; if (!string.IsNullOrEmpty(this.Password)) { credentials.Add(new NameValuePair(LoginRequest.PasswordCredential, this.Password)); } client.Login(credentials); } var connection = new CCConnection(client, new Version(version)); this.WriteObject(connection); }