diff --git a/src/chocolatey.tests.integration/infrastructure.app/services/FilesServiceSpecs.cs b/src/chocolatey.tests.integration/infrastructure.app/services/FilesServiceSpecs.cs index 39e1369299..6f555332a5 100644 --- a/src/chocolatey.tests.integration/infrastructure.app/services/FilesServiceSpecs.cs +++ b/src/chocolatey.tests.integration/infrastructure.app/services/FilesServiceSpecs.cs @@ -43,7 +43,6 @@ public override void Context() _contextPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "infrastructure", "filesystem"); _theLockedFile = Path.Combine(_contextPath, "Slipsum.txt"); _packageResult = new PackageResult("bob", "1.2.3", FileSystem.get_directory_name(_theLockedFile)); - MockLogger.LogMessagesToConsole = true; _fileStream = new FileStream(_theLockedFile, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None); } diff --git a/src/chocolatey/infrastructure.app/ApplicationParameters.cs b/src/chocolatey/infrastructure.app/ApplicationParameters.cs index d5d9043f45..73c58c20c4 100644 --- a/src/chocolatey/infrastructure.app/ApplicationParameters.cs +++ b/src/chocolatey/infrastructure.app/ApplicationParameters.cs @@ -73,8 +73,8 @@ public static class Environment public static readonly string[] ConfigFileExtensions = new string[] {".autoconf",".config",".conf",".cfg",".jsc",".json",".jsonp",".ini",".xml",".yaml"}; - public static string HashProviderFileTooBig = "UnableToDetectChanges_FileTooBig"; - public static string HashProviderFileLocked = "UnableToDetectChanges_FileLocked"; + public static readonly string HashProviderFileTooBig = "UnableToDetectChanges_FileTooBig"; + public static readonly string HashProviderFileLocked = "UnableToDetectChanges_FileLocked"; public static class Tools { diff --git a/src/chocolatey/infrastructure.app/services/PowershellService.cs b/src/chocolatey/infrastructure.app/services/PowershellService.cs index 16d0f43763..2f9259d100 100644 --- a/src/chocolatey/infrastructure.app/services/PowershellService.cs +++ b/src/chocolatey/infrastructure.app/services/PowershellService.cs @@ -31,6 +31,7 @@ public class PowershellService : IPowershellService { private readonly IFileSystem _fileSystem; private readonly string _customImports; + private const string OPERATION_COMPLETED_SUCCESSFULLY = "The operation completed successfully."; public PowershellService(IFileSystem fileSystem) : this(fileSystem, new CustomString(string.Empty)) @@ -269,10 +270,22 @@ public bool run_action(ChocolateyConfiguration configuration, PackageResult pack (s, e) => { if (string.IsNullOrWhiteSpace(e.Data)) return; - failure = true; - this.Log().Error(() => " " + e.Data); + if (e.Data.is_equal_to(OPERATION_COMPLETED_SUCCESSFULLY)) + { + this.Log().Info(() => " " + e.Data); + } + else + { + failure = true; + this.Log().Error(() => " " + e.Data); + } }); + if (exitCode != 0) + { + failure = true; + } + if (failure) { Environment.ExitCode = exitCode;