hi all,
I am trying to use powershell cmdlet invoke-webrequest to access a website that goes to "sleep" after about minutes, and I am trying to write a script using powershell to access the site like every 10 minutes to keep it alive in cache.
this is what I got so far but it's not working for some reason and it's more around the format of the user name and password, because I have to use UNP:
PS C:\> $r = Invoke-WebRequest https://www.DomainName.com/
$r.Forms[0].Name = "UserName@DomainName.com"
$r.Forms[0].Password = "MyPassword"
Invoke-RestMethod https://www.DomainName.com -Body $r
any ideas on how to make this work?
Thanks in advance.
Mohsen Almassud