From add14e452f78f860ca6b7e0ded72f4978e97ba1b Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 10 Jul 2018 22:53:39 -0700 Subject: [PATCH] [Feature] Address Feedback: Do not override user defined cache path --- .../engine/Modules/AnalysisCache.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/System.Management.Automation/engine/Modules/AnalysisCache.cs b/src/System.Management.Automation/engine/Modules/AnalysisCache.cs index 35aa09e4a..b39d52488 100644 --- a/src/System.Management.Automation/engine/Modules/AnalysisCache.cs +++ b/src/System.Management.Automation/engine/Modules/AnalysisCache.cs @@ -1029,9 +1029,10 @@ namespace System.Management.Automation { // If user defines a custom cache path, then use that. string userDefinedCachePath = Environment.GetEnvironmentVariable("PSModuleAnalysisCachePath"); - if (!String.IsNullOrEmpty(userDefinedCachePath)) + if (!string.IsNullOrEmpty(userDefinedCachePath)) { s_cacheStoreLocation = userDefinedCachePath; + return; } string cacheFileName = "ModuleAnalysisCache"; @@ -1057,7 +1058,7 @@ namespace System.Management.Automation string allNames = string.Join(Environment.NewLine, featureNames); // Use SHA1 because it's faster. - // It's very unlikely to get colision from hashing the combinations of enabled features names. + // It's very unlikely to get collision from hashing the combinations of enabled features names. byte[] hashBytes; using (var sha1 = SHA1.Create()) {