Skip to content

Commit f2a17bb

Browse files
🚀 [Refactor]: Streamline context parameter handling by utilizing ForEach-Object for improved readability and performance in Connect-GitHubApp.
1 parent f0b9202 commit f2a17bb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@
196196
$contextParams['Enterprise'] = [string]$installation.Target.Name
197197
}
198198
}
199+
$contextParams
200+
} | ForEach-Object {
199201
Write-Verbose 'Logging in using a managed installation access token...'
200202
$contextParams | Format-Table | Out-String -Stream | ForEach-Object { Write-Verbose $_ }
201203
$contextObj = [GitHubAppInstallationContext]::new((Set-GitHubContext -Context $contextParams.Clone() -PassThru -Default:$Default))
@@ -208,7 +210,7 @@
208210
}
209211
if ($PassThru) {
210212
Write-Debug "Passing context [$contextObj] to the pipeline."
211-
Write-Output $contextObj
213+
$contextObj
212214
}
213215
$contextParams.Clear()
214216
}

0 commit comments

Comments
 (0)