public static string GetApiKey(ISettings settings, string source, bool throwIfNotFound = true) { var value = settings.GetDecryptedValue(CommandLineUtility.ApiKeysSectionName, source); if (String.IsNullOrEmpty(value) && throwIfNotFound) { throw new CommandLineException(NuGetResources.NoApiKeyFound, GetSourceDisplayName(source)); } return value; }