public override void run(ChocolateyConfiguration configuration) { _packageService.ensure_source_app_installed(configuration); // note: you must leave the .ToList() here or else the method won't be evaluated! var packageResults = _packageService.describe_run(configuration).ToList(); // if there are no results, exit with a 2. if (configuration.Features.UseEnhancedExitCodes && packageResults.Count == 0 && Environment.ExitCode == 0) { Environment.ExitCode = 2; } }