FlaUI in PowerShell - FlaUI/FlaUI GitHub Wiki

You can use FlaUI fairly easy in PowerShell. Just load the Core and the desired UIA library into PowerShell and you're ready to go.
PowerShell 3+ Example:

Add-Type -Path 'E:\Development\MyGitHub\FlaUI\src\FlaUI.UIA3\bin\Debug\FlaUI.Core.dll'
Add-Type -Path 'E:\Development\MyGitHub\FlaUI\src\FlaUI.UIA3\bin\Debug\FlaUI.UIA3.dll'

$app = [FlaUI.Core.Application]::Launch('notepad')
$uia = New-Object FlaUI.UIA3.UIA3Automation
$mw = $app.GetMainWindow($uia)
Write-Host $mw.Title
$title = $mw.FindFirstChild($uia.ConditionFactory.ByControlType([FlaUI.Core.Definitions.ControlType]::TitleBar))
$buttons = $title.FindAllChildren($uia.ConditionFactory.ByControlType([FlaUI.Core.Definitions.ControlType]::Button))
$closeButton = $buttons[2].AsButton()
$closeButton.Invoke()
$uia.Dispose()
$app.Dispose()
⚠️ **GitHub.com Fallback** ⚠️