コード例 #1
0
ファイル: LocalPipeline.cs プロジェクト: modulexcite/pash-1
 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));
 }
コード例 #2
0
        public PowerShellExecutor(PowerShellConfiguration powerShellConfiguration)
        {
            Guard.NotNull(powerShellConfiguration, "powerShellConfiguration");

              _powerShellConfiguration = powerShellConfiguration;
        }