Import-Module wasp # Windows Automation Snap-in for Powershell $url = 'https://chaira.udla.edu.co/Chaira/Logon.aspx' $username = $args[0] $password = $args[1] $ie = New-Object -COM InternetExplorer.Application -Property @{ Visible = $true Navigate = $url } while($ie.busy) { #Focus window iexplore $window = Select-UIElement -ProcessName iexplore #Close Chaira Alert $window | Send-UIKeys '{ESCAPE}' } $ie.Document.getElementById("_Usuario").value = $username $ie.Document.getElementById("_Password").value = $password $ie.Document.getElementByID("ext-gen49").Click()