Skip to content

Commit

Permalink
Enhance parameter handling in Get-GitHubRepository function by adding…
Browse files Browse the repository at this point in the history
… verbose output and ensuring null or empty values are removed consistently
  • Loading branch information
MariusStorhaug committed Dec 16, 2024
1 parent f3acef5 commit 7fb98b0
Showing 1 changed file with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ filter Get-GitHubRepository {
PerPage = $PerPage
Since = $Since
Before = $Before
} | Remove-HashtableEntry -NullOrEmptyValues
}
$params | Remove-HashtableEntry -NullOrEmptyValues
Write-Verbose ($params | Format-List | Out-String)
Get-GitHubMyRepositories @params
}
'MyRepos_Aff-Vis' {
Expand All @@ -205,22 +207,28 @@ filter Get-GitHubRepository {
PerPage = $PerPage
Since = $Since
Before = $Before
} | Remove-HashtableEntry -NullOrEmptyValues
}
$params | Remove-HashtableEntry -NullOrEmptyValues
Write-Verbose ($params | Format-List | Out-String)
Get-GitHubMyRepositories @params
}
'ByName' {
$params = @{
Context = $Context
Owner = $Owner
Repo = $Repo
} | Remove-HashtableEntry -NullOrEmptyValues
}
$params | Remove-HashtableEntry -NullOrEmptyValues
Write-Verbose ($params | Format-List | Out-String)
Get-GitHubRepositoryByName @params
}
'ListByID' {
$params = @{
Context = $Context
Since = $SinceID
} | Remove-HashtableEntry -NullOrEmptyValues
}
$params | Remove-HashtableEntry -NullOrEmptyValues
Write-Verbose ($params | Format-List | Out-String)
Get-GitHubRepositoryListByID @params
}
'ListByOrg' {
Expand All @@ -231,7 +239,9 @@ filter Get-GitHubRepository {
Sort = $Sort
Direction = $Direction
PerPage = $PerPage
} | Remove-HashtableEntry -NullOrEmptyValues
}
$params | Remove-HashtableEntry -NullOrEmptyValues
Write-Verbose ($params | Format-List | Out-String)
Get-GitHubRepositoryListByOrg @params
}
'ListByUser' {
Expand All @@ -242,7 +252,9 @@ filter Get-GitHubRepository {
Sort = $Sort
Direction = $Direction
PerPage = $PerPage
} | Remove-HashtableEntry -NullOrEmptyValues
}
$params | Remove-HashtableEntry -NullOrEmptyValues
Write-Verbose ($params | Format-List | Out-String)
Get-GitHubRepositoryListByUser @params
}
}
Expand Down

0 comments on commit 7fb98b0

Please sign in to comment.