From 2e71a090e7aa5243cdbfb8e6e7ffcf6be04022ca Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Mon, 2 May 2016 16:46:26 -0700 Subject: [PATCH] Use ~/.powershell for ConsoleHost profile on Linux --- .../host/msh/ConsoleHost.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs index 04faa65fc7..69898f48a9 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs @@ -170,8 +170,15 @@ namespace Microsoft.PowerShell { try { - var profileDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + - @"\Microsoft\Windows\PowerShell"; + string profileDir; + if (Platform.IsWindows) + { + profileDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + + @"\Microsoft\Windows\PowerShell"; + } else + { + profileDir = System.IO.Path.Combine(Environment.GetEnvironmentVariable("HOME"), ".powershell"); + } if (!Directory.Exists(profileDir)) {