Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用于在随机时间循环上打开URL的PowerShell脚本_Powershell_Command Prompt - Fatal编程技术网

用于在随机时间循环上打开URL的PowerShell脚本

用于在随机时间循环上打开URL的PowerShell脚本,powershell,command-prompt,Powershell,Command Prompt,我需要一个Powershell脚本,它将在随机时间打开3个URL。时间介于10到15分钟之间,将持续运行,直到结束任务 步骤如下: powershell.exe -noprofile -command "Invoke-WebRequest -Uri http://your_url" 假设您只需要启动请求而不关心响应,则可以使用Get Random和Start Sleep以10到15分钟的随机间隔进行睡眠: $url=@( 'http://site.tld/url1' 'http://site

我需要一个Powershell脚本,它将在随机时间打开3个URL。时间介于10到15分钟之间,将持续运行,直到结束任务 步骤如下:

 powershell.exe -noprofile -command "Invoke-WebRequest -Uri http://your_url"

假设您只需要启动请求而不关心响应,则可以使用
Get Random
Start Sleep
以10到15分钟的随机间隔进行睡眠:

$url=@(
'http://site.tld/url1'
'http://site.tld/url2'
'http://site.tld/url3'
)
$minSeconds=10*60
$maxSeconds=15*600
#永远循环
while($true){
#向所有3个URL发送请求
$url | ForEach对象{
调用WebRequest-Uri$_
}
#随机睡眠10到15分钟
开始睡眠-秒(随机获取-最小$minSeconds-最大$maxSeconds)
}

是否要捕获URL调用的响应?