PowerShell In GUI Blog

PowerShell GUI Box Just In A Few Clicks

Tip of the day: using wildcards in UIAutomation

leave a comment »

One of amazing features of PowerShell cmdlets is supporting so-called wildcards. What are wildcards? The characters that substitute one or more, or even all of the characters in the string.
For example, you need to simplify your code:

Start-Process calc -PassThru | Get-UIAWindow | Get-UIAButton -Name a* | Invoke-UIAButtonClick;

This code presses the plus button, the button that is named Add.
Imagine that you need to press the Reciprocal button and you’ll immediately love wildcards.

Advertisements

Written by Alexander Petrovskiy

August 26, 2012 at 9:17 am

Posted in Powershell, tip

Tagged with

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: