protected override void ProcessRecord()
        {
            AutomationElement root  = this.Root ?? AutomationElement.RootElement;
            TreeScope         scope = this.Recurse.IsPresent ? TreeScope.Descendants : TreeScope.Children;

            Condition[] conditions = this.Condition ?? TrueCondition;
            foreach (var condition in conditions)
            {
                var results        = root.FindAll(scope, condition);
                var wrappedResults = PSObjectFactory.WrapElements(results.OfType <AutomationElement>());
                this.WriteObject(wrappedResults, true);
            }
        }
Esempio n. 2
0
 protected override void ProcessRecord()
 {
     this.WriteObject(PSObjectFactory.WrapElement(AutomationElement.RootElement));
 }