From 662e3909027db661d3a0413f8a76d04dbb635126 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Thu, 14 Jul 2016 14:57:46 -0700 Subject: [PATCH] Remove Platform.HasGroupPolicySupport query --- .../CoreCLR/CorePsPlatform.cs | 6 ------ src/System.Management.Automation/engine/Utils.cs | 11 ++++------- 2 files changed, 4 insertions(+), 13 deletions(-) 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>();