Exemplo n.º 1
0
 private static bool StringArrayTypeValidationCallback(string key, object obj, PSCmdlet cmdlet, string path)
 {
     if (DISCPowerShellConfiguration.TryGetStringArray(obj) == null)
     {
         cmdlet.WriteVerbose(StringUtil.Format(RemotingErrorIdStrings.DISCTypeMustBeStringArray, key, path));
         return(false);
     }
     return(true);
 }
Exemplo n.º 2
0
 internal static void ValidateExtensions(Hashtable table, string filePath)
 {
     if (table.ContainsKey(ConfigFileContants.TypesToProcess))
     {
         ValidatePS1XMLExtension(ConfigFileContants.TypesToProcess, DISCPowerShellConfiguration.TryGetStringArray(table[ConfigFileContants.TypesToProcess]), filePath);
     }
     if (table.ContainsKey(ConfigFileContants.FormatsToProcess))
     {
         ValidatePS1XMLExtension(ConfigFileContants.FormatsToProcess, DISCPowerShellConfiguration.TryGetStringArray(table[ConfigFileContants.FormatsToProcess]), filePath);
     }
     if (table.ContainsKey(ConfigFileContants.ScriptsToProcess))
     {
         ValidatePS1OrPSM1Extension(ConfigFileContants.ScriptsToProcess, DISCPowerShellConfiguration.TryGetStringArray(table[ConfigFileContants.ScriptsToProcess]), filePath);
     }
 }
Exemplo n.º 3
0
 internal static void ValidateAbsolutePaths(SessionState state, Hashtable table, string filePath)
 {
     if (table.ContainsKey(ConfigFileContants.TypesToProcess))
     {
         ValidateAbsolutePath(state, ConfigFileContants.TypesToProcess, DISCPowerShellConfiguration.TryGetStringArray(table[ConfigFileContants.TypesToProcess]), filePath);
     }
     if (table.ContainsKey(ConfigFileContants.FormatsToProcess))
     {
         ValidateAbsolutePath(state, ConfigFileContants.FormatsToProcess, DISCPowerShellConfiguration.TryGetStringArray(table[ConfigFileContants.FormatsToProcess]), filePath);
     }
     if (table.ContainsKey(ConfigFileContants.ScriptsToProcess))
     {
         ValidateAbsolutePath(state, ConfigFileContants.ScriptsToProcess, DISCPowerShellConfiguration.TryGetStringArray(table[ConfigFileContants.ScriptsToProcess]), filePath);
     }
 }