Skip to content

Instantly share code, notes, and snippets.

@alevyinroc
Created December 14, 2018 18:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alevyinroc/93137886fee6d1eccc6389464470a320 to your computer and use it in GitHub Desktop.
Save alevyinroc/93137886fee6d1eccc6389464470a320 to your computer and use it in GitHub Desktop.
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