gpt4 book ai didi

powershell - 调用WebRequest设置超时

转载 作者:行者123 更新时间:2023-12-03 13:31:15 24 4
gpt4 key购买 nike

我有一个运行很长时间的网页,需要Powershell来调用。我每晚在任务管理器中运行以下命令:

powershell -Command "Invoke-WebRequest https://www.example.com/longrunningtask" 

但是Powershell超时发生在网站响应之前。有什么办法可以将 Invoke-WebRequest的超时设置为比标准60秒更长?

最佳答案

应该有一个-TimeoutSec参数,您可以在调用Invoke-WebRequest cmdlet时将整数值提供给该参数。

Invoke-WebRequest https://www.example.com/longrunningtask -TimeoutSec 60

关于powershell - 调用WebRequest设置超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34136088/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com