diff --git a/src/chocolatey.tests.integration/scenarios/ListScenarios.cs b/src/chocolatey.tests.integration/scenarios/ListScenarios.cs index cf72223c35..d00930ddd8 100644 --- a/src/chocolatey.tests.integration/scenarios/ListScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/ListScenarios.cs @@ -21,6 +21,7 @@ using NuGet.Configuration; using FluentAssertions; using FluentAssertions.Execution; +using NUnit.Framework; namespace chocolatey.tests.integration.scenarios { @@ -140,7 +141,10 @@ public void Should_contain_packages_and_versions_with_a_pipe_between_them() MockLogger.ContainsMessage("upgradepackage|1.0.0").Should().BeTrue(); } + // Windows only because decryption fallback on Mac/Linux logs a message [Fact] + [WindowsOnly] + [Platform(Exclude = "Mono")] public void Should_only_have_messages_related_to_package_information() { MockLogger.Messages.Should() diff --git a/src/chocolatey/infrastructure.app/services/NugetService.cs b/src/chocolatey/infrastructure.app/services/NugetService.cs index eed43df34c..8316938a52 100644 --- a/src/chocolatey/infrastructure.app/services/NugetService.cs +++ b/src/chocolatey/infrastructure.app/services/NugetService.cs @@ -192,6 +192,7 @@ it is possible that incomplete package lists are returned from a command foreach (var pkg in NugetList.GetPackages(config, _nugetLogger, _fileSystem)) { var package = pkg; // for lamda access + string packageArgumentsUnencrypted = null; ChocolateyPackageMetadata packageLocalMetadata; string packageInstallLocation = null; @@ -218,6 +219,10 @@ it is possible that incomplete package lists are returned from a command } deploymentLocation = packageInfo.DeploymentLocation; + if (!string.IsNullOrWhiteSpace(packageInfo.Arguments)) + { + packageArgumentsUnencrypted = "\n Remembered Package Arguments: " + (packageInfo.Arguments.ContainsSafe(" --") && packageInfo.Arguments.ToStringSafe().Length > 4 ? packageInfo.Arguments : NugetEncryptionUtility.DecryptString(packageInfo.Arguments)); + } } if (!config.QuietOutput) @@ -244,7 +249,7 @@ Package url{6} Tags: {9} Software Site: {10} Software License: {11}{12}{13}{14}{15}{16} - Description: {17}{18}{19} + Description: {17}{18}{19}{20} ".FormatWith( package.Title.EscapeCurlyBraces(), package.Published.GetValueOrDefault().UtcDateTime.ToShortDateString(), @@ -279,7 +284,8 @@ Package url{6} package.Summary != null && !string.IsNullOrWhiteSpace(package.Summary.ToStringSafe()) ? "\r\n Summary: {0}".FormatWith(package.Summary.EscapeCurlyBraces().ToStringSafe()) : string.Empty, package.Description.EscapeCurlyBraces().Replace("\n ", "\n").Replace("\n", "\n "), !string.IsNullOrWhiteSpace(package.ReleaseNotes.ToStringSafe()) ? "{0} Release Notes: {1}".FormatWith(Environment.NewLine, package.ReleaseNotes.EscapeCurlyBraces().Replace("\n ", "\n").Replace("\n", "\n ")) : string.Empty, - !string.IsNullOrWhiteSpace(deploymentLocation) ? "{0} Deployed to: '{1}'".FormatWith(Environment.NewLine, deploymentLocation) : string.Empty + !string.IsNullOrWhiteSpace(deploymentLocation) ? "{0} Deployed to: '{1}'".FormatWith(Environment.NewLine, deploymentLocation) : string.Empty, + packageArgumentsUnencrypted != null ? packageArgumentsUnencrypted : string.Empty )); } }