Please Help I have a website I have a problem stopping iis sometimes Please help with this code Condition does not work I want to do this
If you go to the next page success else Restart iis
$url = "https://alatheirvas.com:8443/Login.aspx"
$username="hgeyf4125"
$password="123456"
$ie = New-Object -com internetexplorer.application;
$ie.visible = $true;
$ie.navigate($url);
while ($ie.Busy -eq $true)
{
Start-Sleep 1;
}
$ie.Document.getElementById("Login2_UserName").value = $username
$ie.Document.getElementByID("Login2_Password").value=$password
$ie.Document.getElementById("Login2_LoginButton").Click();
while($ie.busy) {sleep 1}
The previous steps are correct
What is the next step to accomplish this
If logged in and go to the next page success
else Restart iis
if ($url = "https://alatheirvas.com:8443/agent/") {
"success"
} else {
iisreset
}
---------------------------------------------------------------
I want to accomplish this in any way possible
Invoke-WebRequest
with appropriate HTTP headers springs to mind. It depends on what you're trying to accomplish.