v0.42.0
🚀 [Feature]: Custom properties now included in repository queries by default (#561)
Repository queries by name and by owner now return CustomProperties by default — no additional parameters needed. Fork listings now also return typed [GitHubRepository] objects instead of raw API responses, making them consistent with other repository commands.
- Fixes #560
New: Custom properties included in by-name and by-owner queries
Get-GitHubRepository now returns CustomProperties when querying by name or listing by owner, without needing -AdditionalProperty 'CustomProperties'.
# Both of these now include CustomProperties in the output:
Get-GitHubRepository -Owner 'myorg' -Name 'myrepo'
Get-GitHubRepository -Owner 'myorg'Previously, these required an explicit parameter:
# Before: required -AdditionalProperty to get CustomProperties
Get-GitHubRepository -Owner 'myorg' -Name 'myrepo' -AdditionalProperty 'CustomProperties'Changed: Fork listings return typed repository objects
Get-GitHubRepositoryFork now returns [GitHubRepository] objects instead of raw PSCustomObject responses. This means fork listings include all typed properties (including CustomProperties), consistent with other repository commands.
$forks = Get-GitHubRepositoryFork -Owner 'octocat' -Name 'Hello-World'
$forks[0].GetType().Name # GitHubRepository (was PSCustomObject)Technical Details
- Added
'CustomProperties'to the default$Propertyarray in two private GraphQL functions:Get-GitHubRepositoryByNameandGet-GitHubRepositoryListByOwner. This causes the GraphQL query to include therepositoryCustomPropertyValues(first: 100) { nodes { propertyName value } }sub-query by default. Get-GitHubMyRepositoriesandGet-GitHubMyRepositoryByNamewere initially updated but reverted — these authenticated-user queries do not need the change.- Updated
Get-GitHubRepositoryForkto cast each response item via[GitHubRepository]::new($repo)and added[OutputType([GitHubRepository])], matching the pattern used byGet-GitHubRepositoryListByTeam. - No changes to the
GitHubRepositoryclass — it already supports both REST (custom_properties) and GraphQL (repositoryCustomPropertyValues.nodes) formats in its constructors.