Exemple #1
0
        protected override void EndProcessing()
        {
            var outList = new List <PoshMethod>();

            for (int i = 0; i < list.Count; i++)
            {
                Type t = list[i];
                IEnumerable <MethodInfo> allMethods = t.GetMethods(realFlags);
                if (this.MyInvocation.BoundParameters.ContainsKey("MethodName"))
                {
                    allMethods = allMethods.Where(x => MethodName.Any(n => n.Equals(x.Name, StringComparison.CurrentCultureIgnoreCase)));
                }
                else if (!this.MyInvocation.BoundParameters.ContainsKey("Force"))
                {
                    allMethods = allMethods.Where(x => !x.Name.Contains("_"));
                }
                foreach (MethodInfo mi in allMethods)
                {
                    outList.Add(mi);
                }
            }
            outList.Sort(new PoshMethodSorter());

            WriteObject(outList, true);
        }