public async Task <TaskAgent> GetAgentAsync(AgentSettings agentSettings)
        {
            var agents = await _agentServer.GetAgentsAsync(agentSettings.PoolId, agentSettings.AgentName);

            Trace.Verbose("Returns {0} agents", agents.Count);
            return(agents.FirstOrDefault());
        }
        private async Task <TaskAgent> GetAgent(string name, int poolId)
        {
            List <TaskAgent> agents = await _agentServer.GetAgentsAsync(poolId, name);

            Trace.Verbose("Returns {0} agents", agents.Count);
            TaskAgent agent = agents.FirstOrDefault();

            return(agent);
        }