diff --git a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs index 1e7e979e52..2cac3ebd5d 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs @@ -217,12 +217,6 @@ namespace System.Management.Automation } - // Linux does not have group policy support - internal static bool HasGroupPolicySupport() - { - return IsWindows; - } - // non-windows does not have network drive support internal static bool HasNetworkDriveSupport() { diff --git a/src/System.Management.Automation/engine/Utils.cs b/src/System.Management.Automation/engine/Utils.cs index 7c5cdbe3ac..87c2962eaa 100644 --- a/src/System.Management.Automation/engine/Utils.cs +++ b/src/System.Management.Automation/engine/Utils.cs @@ -649,13 +649,9 @@ namespace System.Management.Automation internal static Dictionary GetGroupPolicySetting(string groupPolicyBase, string settingName, RegistryKey[] preferenceOrder) { - if (!Platform.HasGroupPolicySupport()) - { - // Porting note: No group policy support means we have an empty set of - // policies. - return _emptyDictionary; - } - +#if LINUX + return _emptyDictionary; +#else lock (cachedGroupPolicySettings) { // Return cached information, if we have it @@ -730,6 +726,7 @@ namespace System.Management.Automation return settings; } +#endif } static ConcurrentDictionary> cachedGroupPolicySettings = new ConcurrentDictionary>();