The Get-UIAControlAncestors cmdlet returns all the ancestry of a control (i.e., the parent, its parent, its respective parent, ...):
Start-Process calc -PassThru | Get-UIAWindow | Get-UIAButton -Name 1 | Get-UIAControlAncestors | %{ Write-Host $_.Current.ControlType.ProgrammaticName $_.Current.Name $_.Current.AutomationId; };

Tags: TreeScope.Ancestors

Last edited Jan 22, 2013 at 4:59 AM by xinliu, version 3

Comments

No comments yet.