From d5f6295042b3aafb241828f20f85a1666602c4dd Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Mon, 6 Jun 2016 14:26:13 -0700 Subject: [PATCH] Update ModuleAnalysisCache to use XDGBDS on Linux --- .../engine/Modules/AnalysisCache.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/System.Management.Automation/engine/Modules/AnalysisCache.cs b/src/System.Management.Automation/engine/Modules/AnalysisCache.cs index bcdcbe4962..af4acc2bfa 100644 --- a/src/System.Management.Automation/engine/Modules/AnalysisCache.cs +++ b/src/System.Management.Automation/engine/Modules/AnalysisCache.cs @@ -1015,8 +1015,10 @@ namespace System.Management.Automation { cacheStoreLocation = Environment.GetEnvironmentVariable("PSModuleAnalysisCachePath") ?? - Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), - @"Microsoft\Windows\PowerShell\ModuleAnalysisCache"); + (Platform.IsWindows + ? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), + @"Microsoft\Windows\PowerShell\ModuleAnalysisCache") + : Path.Combine(Platform.SelectProductNameForDirectory(Platform.XDG_Type.CACHE), "ModuleAnalysisCache")); } }