Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
Makes dump_commits_since.ps1 work on PowerShell 5.1 (#7680)
Browse files Browse the repository at this point in the history
  • Loading branch information
ike709 authored Apr 21, 2022
1 parent 20fb340 commit 9757382
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Tools/dump_commits_since.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ param(

$r = @()

$page = 1

$qParams = @{
"since" = $since.ToString("o");
"per_page" = 100
"page" = $page
}

if ($until -ne $null) {
Expand All @@ -24,11 +27,19 @@ if ($until -ne $null) {

$url = "https://api.github.com/repos/{0}/commits" -f $repo



while ($null -ne $url)
{
$resp = Invoke-WebRequest $url -Body $qParams
$resp = Invoke-WebRequest $url -UseBasicParsing -Body $qParams

if($resp.Content.Length -eq 2) {
break
}

$url = $resp.RelationLink.next
$page += 1
$qParams["page"] = $page


$j = ConvertFrom-Json $resp.Content
$r += $j
Expand Down

0 comments on commit 9757382

Please sign in to comment.