Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jonathanmedd/cd9f7451a06b308cd94454fcac233198 to your computer and use it in GitHub Desktop.
Save jonathanmedd/cd9f7451a06b308cd94454fcac233198 to your computer and use it in GitHub Desktop.
PowerShell Parallel Example GitHubUsers
$users = Invoke-RestMethod -Uri 'https://api.github.com/users'
$users | ForEach-Object -Parallel {
Write-Output "GitHub User $($_.login) has ID $($_.id)"
$Seconds = (Get-Random -Minimum 1 -Maximum 10)
Start-Sleep -Seconds $Seconds
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment