Skip to content

Instantly share code, notes, and snippets.

@cdhunt
Last active January 23, 2018 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdhunt/9a23d16b76290b11a3b256e2a0dd3fbb to your computer and use it in GitHub Desktop.
Save cdhunt/9a23d16b76290b11a3b256e2a0dd3fbb to your computer and use it in GitHub Desktop.
Download Simulator
#requires -Module NameIt
while ($true) {
$limit = Get-Random -Minimum 500 -Maximum 4000
$t = 0
$p = 0
$r=ig "[adjective]-[noun]_v#.#.##."
$r += @('zip', 'exe', '7zip') | Get-Random
while($p -lt 100) {
$sleep = Get-Random -Minimum 25 -Maximum 800
Write-Progress -Activity "Downloading" -PercentComplete $p -Status "$r"
Start-Sleep -Milliseconds $sleep
$t += $sleep
$p = ($t/$limit)*100
}
Write-Progress -Activity "Downloading" -Completed
Start-Sleep -Milliseconds 150
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment