Last active
February 5, 2016 17:56
-
-
Save smitmartijn/140484dd64fa0909b5e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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