internal static int ReadRegistryInt(string policyValueName, int defaultValue) { if (PowerShellConfiguration.IsWindows) { RegistryKey key; try { key = Registry.LocalMachine.OpenSubKey(Utils.GetRegistryConfigurationPrefix()); } catch (SecurityException) { return(defaultValue); } if (key != null) { object obj2; try { obj2 = key.GetValue(policyValueName); } catch (SecurityException) { return(defaultValue); } if (obj2 is int) { return((int)obj2); } } return(defaultValue); } return(PowerShellConfiguration.GetPolicyValue(policyValueName, defaultValue)); }
public PowerShellExecutor(PowerShellConfiguration powerShellConfiguration) { Guard.NotNull(powerShellConfiguration, "powerShellConfiguration"); _powerShellConfiguration = powerShellConfiguration; }