Skip to content

Instantly share code, notes, and snippets.

@smitmartijn
Last active February 5, 2016 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smitmartijn/140484dd64fa0909b5e3 to your computer and use it in GitHub Desktop.
Save smitmartijn/140484dd64fa0909b5e3 to your computer and use it in GitHub Desktop.
$Url = "http://www.example.com/path"
$Username="user"
$Password="password"
# Invoke Internet Explorer
$IE = New-Object -com internetexplorer.application;
$IE.visible = $true;
$IE.navigate($Url);
# Wait untill the page is loaded
while ($IE.Busy -eq $true)
{
Start-Sleep -Milliseconds 2000;
}
# Fill login details
$IE.Document.getElementById("input_username").value = $Username;
$IE.Document.getElementById("input_password").value = $Password;
# Click the submit button
$IE.Document.getElementById("input_go").Click();
# Wait for the page to load
while ($IE.Busy -eq $true) { Start-Sleep -Milliseconds 1000; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment