Пример #1
0
 internal static void VerifyPSSnapInFormatThrowIfError(string psSnapinId)
 {
     if (!PSSnapInInfo.IsPSSnapinIdValid(psSnapinId))
     {
         throw PSSnapInInfo._tracer.NewArgumentException("mshSnapInId", "MshSnapInCmdletResources", "InvalidPSSnapInName", (object)psSnapinId);
     }
 }
Пример #2
0
 private static bool PSv2IsCommandLikeCmdlet(string lastWord, out bool isSnapinSpecified)
 {
     isSnapinSpecified = false;
     string[] strArray = lastWord.Split(new char[] { '\\' });
     if (strArray.Length == 1)
     {
         return(CmdletTabRegex.IsMatch(lastWord));
     }
     if (strArray.Length == 2)
     {
         isSnapinSpecified = PSSnapInInfo.IsPSSnapinIdValid(strArray[0]);
         if (isSnapinSpecified)
         {
             return(CmdletTabRegex.IsMatch(strArray[1]));
         }
     }
     return(false);
 }
Пример #3
0
 private static bool IsCommandLikeCmdlet(string lastWord, out bool isPSSnapInSpecified)
 {
     isPSSnapInSpecified = false;
     string[] strArray = lastWord.Split('\\');
     if (strArray.Length == 1)
     {
         return(CommandCompletionBase.cmdletTabRegex.IsMatch(lastWord));
     }
     if (strArray.Length == 2)
     {
         isPSSnapInSpecified = PSSnapInInfo.IsPSSnapinIdValid(strArray[0]);
         if (isPSSnapInSpecified)
         {
             return(CommandCompletionBase.cmdletTabRegex.IsMatch(strArray[1]));
         }
     }
     return(false);
 }