Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions powershell-lts/patches/global-profiles-stores-in-etc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs b/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs
index 439826984..d08d21f86 100644
--- a/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs
+++ b/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs
@@ -255,16 +255,9 @@ namespace System.Management.Automation
/// <returns>The base path for all users profiles.</returns>
private static string GetAllUsersFolderPath(string shellId)
{
- string folderPath = string.Empty;
- try
- {
- folderPath = Utils.GetApplicationBase(shellId);
- }
- catch (System.Security.SecurityException)
- {
- }
-
- return folderPath;
+ string folderPath = Environment.GetEnvironmentVariable("POWERSHELL_COMMON_APPLICATION_DATA");
+ if (!string.IsNullOrEmpty(folderPath)) return folderPath;
+ return "/etc/opt/powershell";
}
#endregion GetProfileCommands

24 changes: 24 additions & 0 deletions powershell-preview/patches/global-profiles-stores-in-etc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs b/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs
index 003625791..18dbda34f 100644
--- a/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs
+++ b/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs
@@ -233,16 +233,9 @@ namespace System.Management.Automation
/// <returns>The base path for all users profiles.</returns>
private static string GetAllUsersFolderPath(string shellId)
{
- string folderPath = string.Empty;
- try
- {
- folderPath = Utils.GetApplicationBase(shellId);
- }
- catch (System.Security.SecurityException)
- {
- }
-
- return folderPath;
+ string folderPath = Environment.GetEnvironmentVariable("POWERSHELL_COMMON_APPLICATION_DATA");
+ if (!string.IsNullOrEmpty(folderPath)) return folderPath;
+ return "/etc/opt/powershell";
}
#endregion GetProfileCommands

24 changes: 24 additions & 0 deletions powershell-stable/patches/global-profiles-stores-in-etc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs b/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs
index 003625791..18dbda34f 100644
--- a/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs
+++ b/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs
@@ -233,16 +233,9 @@ namespace System.Management.Automation
/// <returns>The base path for all users profiles.</returns>
private static string GetAllUsersFolderPath(string shellId)
{
- string folderPath = string.Empty;
- try
- {
- folderPath = Utils.GetApplicationBase(shellId);
- }
- catch (System.Security.SecurityException)
- {
- }
-
- return folderPath;
+ string folderPath = Environment.GetEnvironmentVariable("POWERSHELL_COMMON_APPLICATION_DATA");
+ if (!string.IsNullOrEmpty(folderPath)) return folderPath;
+ return "/etc/opt/powershell";
}
#endregion GetProfileCommands