Skip to content

Commit b09f438

Browse files
Milestone
1 parent 128418e commit b09f438

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

src/functions/public/Auth/Connect-GitHubApp.ps1

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@
158158
Write-Verbose "Found [$($selectedInstallations.Count)] installations for the target."
159159
$moduleName = $script:Module.Name
160160
$moduleVersion = $script:PSModuleInfo.ModuleVersion
161-
$contextParamList = , @()
162-
$contextParamList = $selectedInstallations | ForEach-Object -ThrottleLimit $ThrottleLimit -Parallel {
161+
$selectedInstallations | ForEach-Object -ThrottleLimit $ThrottleLimit -Parallel {
163162
Import-Module -Name $using:moduleName -RequiredVersion $using:moduleVersion -Force -ErrorAction Stop
164163
$installation = $_
165164
Write-Verbose "Processing installation [$($installation.Target.Name)] [$($installation.id)]"
@@ -197,16 +196,6 @@
197196
$contextParams['Enterprise'] = [string]$installation.Target.Name
198197
}
199198
}
200-
$contextParams
201-
}
202-
foreach ($contextParams in $contextParamList) {
203-
$null = $contextObjects.Add($contextParams)
204-
}
205-
$null = $selectedInstallations.Clear()
206-
}
207-
208-
end {
209-
foreach ($contextParams in $contextObjects) {
210199
Write-Verbose 'Logging in using a managed installation access token...'
211200
$contextParams | Format-Table | Out-String -Stream | ForEach-Object { Write-Verbose $_ }
212201
$contextObj = [GitHubAppInstallationContext]::new((Set-GitHubContext -Context $contextParams.Clone() -PassThru -Default:$Default))
@@ -223,6 +212,9 @@
223212
}
224213
$contextParams.Clear()
225214
}
215+
}
216+
217+
end {
226218
Write-Debug "[$stackPath] - End"
227219
}
228220
}

0 commit comments

Comments
 (0)