public TaskSettings GetTask(string name)
{
if (Tasks == null)
{
throw new InvalidOperationException("Tasks is null");
}
var task = Tasks.FirstOrDefault(criteria => criteria.Name == name);
if (task == null)
{
throw new InvalidOperationException("Could not find task: " + name);
}
return task;
}
}