Skip to content

Commit 47de971

Browse files
authored
Add progress to Add-AzsdkMilestones.ps1 (#6537)
1 parent 0679c00 commit 47de971

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tools/github/scripts/Add-AzsdkMilestones.ps1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ if ($PSCmdlet.ParameterSetName -eq 'RepositoryFile') {
4545
}
4646

4747
$date = $StartDate
48-
$milestones = do {
48+
[pscustomobject[]] $milestones = do {
4949
# Start with the first of the month at 23:59 UTC.
5050
$date = [DateTimeOffset]::Parse("$($date.ToString('yyyy-MM'))-01T23:59:59Z")
5151

@@ -68,8 +68,13 @@ if (!$milestones) {
6868
return
6969
}
7070

71+
$completed = 0
72+
$total = $Repositories.Length * $milestones.Length
73+
Write-Progress -Activity ($activity = 'Creating milestones') -PercentComplete 0
74+
7175
foreach ($repo in $Repositories) {
7276
foreach ($m in $milestones) {
77+
Write-Progress -Activity $activity -Status "In $repo" -CurrentOperation "Milestone $($m.Title)" -PercentComplete ($completed / $total * 100)
7378
if ($Force -or $PSCmdlet.ShouldProcess(
7479
"Creating milestone $($m.Title) ending $($m.DueOn) in $repo",
7580
"Create milestone $($m.Title) ending $($m.DueOn) in $repo?",
@@ -85,8 +90,10 @@ foreach ($repo in $Repositories) {
8590
Write-Verbose "Created $($result.url) for milestone $($m.Title) in $repo"
8691
}
8792
}
93+
$completed++
8894
}
8995
}
96+
Write-Progress -Activity $activity -Completed
9097

9198
<#
9299
.SYNOPSIS

0 commit comments

Comments
 (0)