Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import-module poshrsjob;
$DownloadDir = "/users/andy/Downloads/poshrsjob";
$MaxJobs = 3;
foreach ($i in 1..24) {
Start-RSJob -Throttle $MaxJobs -Batch "Demo" -argumentlist $i, $DownloadDir -ScriptBlock {
param($JobNum, $OutputDir)
$OutputFile = Join-Path -Path $OutputDir -ChildPath "RSJob$JobNum.zip";
Start-Sleep -Seconds (get-random -Minimum 1 -Maximum 15);
Invoke-WebRequest -uri "https://github.com/proxb/PoshRSJob/archive/master.zip" -OutFile $OutputFile;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment