AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages. AutoItX is a DLL version of AutoIt v3 that provides a subset of the features of AutoIt via an ActiveX/COM and DLL interface. This means that you can add AutoIt-like features to your VMware PowerShell script.
Invoke-Item c:\windows\notepad.exe
Get-VIServer esx35.ntpro.local -User root -Password vmware
$autoitx=new-object -com autoitx3.control
$MyHost = Get-VMHost esx35.ntpro.local
$HostView = Get-View $MyHost.ID
$NetworkSystem = get-view $HostView.ConfigManager.NetworkSystem
$AllPortGroups = $NetworkSystem.NetworkInfo.Portgroup
$autoitx.winactivate("Untitled - Notepad","")
foreach ($HostPortGroup in $AllPortGroups){$autoitx.send($HostPortGroup.Spec.Name + "`r") }