diff --git a/src/functions/private/Apps/Get-GitHubAppByName.ps1 b/src/functions/private/Apps/Get-GitHubAppByName.ps1 index 83ce4356..cf9ac29d 100644 --- a/src/functions/private/Apps/Get-GitHubAppByName.ps1 +++ b/src/functions/private/Apps/Get-GitHubAppByName.ps1 @@ -30,15 +30,25 @@ [object] $Context = (Get-GitHubContext) ) - $Context = Resolve-GitHubContext -Context $Context - - $inputObject = @{ - Context = $Context - APIEndpoint = "/apps/$AppSlug" - Method = 'GET' + begin { + $commandName = $MyInvocation.MyCommand.Name + Write-Verbose "[$commandName] - Start" + $Context = Resolve-GitHubContext -Context $Context + Assert-GitHubContext -Context $Context -AuthType IAT, PAT, UAT } - Invoke-GitHubAPI @inputObject | ForEach-Object { - Write-Output $_.Response + process { + $inputObject = @{ + Context = $Context + APIEndpoint = "/apps/$AppSlug" + Method = 'GET' + } + + Invoke-GitHubAPI @inputObject | ForEach-Object { + Write-Output $_.Response + } + } + end { + Write-Verbose "[$commandName] - End" } }