PS:4.0 $dir='torrent' if( -not (Test-Path $dir) ) { mkdir $dir } foreach($i in 1..2049) { $request = Invoke-WebRequest "http://www.vvtor.com/?dl_id=$i" if ($request.RawContent -match "''(?<fileName>.*).torrent") { $fileName = "c:\$dir\$($Matches.fileName).torrent" [system.io.file]::WriteAllBytes($fileName,$request.Content) } } 下载的文件会保存在C:\torrent\
转载于:https://blog.51cto.com/lixiaosong/1425016