Created
January 23, 2020 16:19
-
-
Save jonathanmedd/cd9f7451a06b308cd94454fcac233198 to your computer and use it in GitHub Desktop.
PowerShell Parallel Example GitHubUsers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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