I have a long running web page that I need Powershell to call. I run it on a nightly basis from the task manager, with the following:
powershell -Command "Invoke-WebRequest https://www.example.com/longrunningtask"
but the powershell timeout occurs before the website responds. Is there any way to set the timeout on Invoke-WebRequest
to be longer than the standard 60 seconds?
There should be an -TimeoutSec
parameter you can feed an integer value to when calling the Invoke-WebRequest
cmdlet.
Invoke-WebRequest https://www.example.com/longrunningtask -TimeoutSec 60
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With