Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- param(
- [string]$interval
- )
- function Refresh-WebPages {
- "Neptun refresh every $interval seconds."
- "press any key to exit."
- $shell = New-Object -ComObject Shell.Application
- do {
- Start-Sleep -Seconds $interval
- 'Refreshing'
- $shell.Windows() |
- Where-Object { $_.Document.url } |
- ForEach-Object { $_.Refresh() }
- } until ( [System.Console]::KeyAvailable )
- [System.Console]::ReadKey($true) | Out-Null
- }
- $username = "asd";
- $SecureString = Read-Host "password" -AsSecureString;
- $BSTR =
- [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString);
- $PlainPassword =
- [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)
- $IE=new-object -com internetexplorer.application;
- $IE.navigate2("https://hallgato.neptun.elte.hu/login.aspx");
- $IE.visible=$true;
- While ($IE.Busy -eq $true) {Start-Sleep -Milliseconds 500}
- $IE.Document.getElementById('user').value = "$username";
- $IE.Document.getElementById('pwd').value = "$PlainPassword";
- ($IE.document.getElementById('btnSubmit') |select -first 1).click();
- Refresh-WebPages -interval
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement