Description
Get-GitHubRepositoryCustomProperty exists, but the module has no way to write custom property values or to manage the property definitions (schema) at the organization or enterprise level. This makes it impossible to drive repository custom properties as a fleet-management control from PowerShell.
Motivating consumer
MSXOrg/Custo (see PR #1) is a policy engine that distributes managed files to subscribing repositories based on their Type and SubscribeTo custom properties, and centrally maintains the allowed values of those properties at the enterprise level. It currently hand-rolls these calls through Invoke-GitHubAPI (and a PAT for the enterprise endpoints). That logic belongs in this module so consumers get consistent objects, ShouldProcess, pagination and retry for free.
Proposed cmdlets
Repository property values
Set-GitHubRepositoryCustomProperty — PATCH /repos/{owner}/{repo}/properties/values (create/update/remove values on a repo). Pipeline-friendly with Get-GitHubRepositoryCustomProperty.
Organization property schema (allowed values / definitions)
Get-GitHubOrganizationCustomProperty — GET /orgs/{org}/properties/schema and .../schema/{name}
Set-GitHubOrganizationCustomProperty — PUT /orgs/{org}/properties/schema/{name}
Remove-GitHubOrganizationCustomProperty — DELETE /orgs/{org}/properties/schema/{name}
Set-GitHubOrganizationCustomPropertyValue — PATCH /orgs/{org}/properties/values (bulk-assign values across repos)
Enterprise property schema (allowed values / definitions)
Get-GitHubEnterpriseCustomProperty — GET /enterprises/{enterprise}/properties/schema and .../schema/{name}
Set-GitHubEnterpriseCustomProperty — PUT /enterprises/{enterprise}/properties/schema/{name}
Remove-GitHubEnterpriseCustomProperty — DELETE /enterprises/{enterprise}/properties/schema/{name}
(Names are suggestions — happy to align with the module's conventions.)
Notes / considerations
- Auth: enterprise endpoints require enterprise-admin authorization. A GitHub App may use the "Enterprise custom properties for organizations" permission where available; otherwise a PAT with
admin:enterprise is required. The cmdlets should work with whichever -Context token is supplied and surface a clear error when the token lacks scope, rather than silently failing.
- Idempotency: support
-WhatIf/SupportsShouldProcess so callers can preview changes (Custo diffs current vs desired before writing).
- Shape:
single_select / multi_select / string / true_false value types, allowed_values, values_editable_by, required, default_value.
References
Description
Get-GitHubRepositoryCustomPropertyexists, but the module has no way to write custom property values or to manage the property definitions (schema) at the organization or enterprise level. This makes it impossible to drive repository custom properties as a fleet-management control from PowerShell.Motivating consumer
MSXOrg/Custo(see PR #1) is a policy engine that distributes managed files to subscribing repositories based on theirTypeandSubscribeTocustom properties, and centrally maintains the allowed values of those properties at the enterprise level. It currently hand-rolls these calls throughInvoke-GitHubAPI(and a PAT for the enterprise endpoints). That logic belongs in this module so consumers get consistent objects,ShouldProcess, pagination and retry for free.Proposed cmdlets
Repository property values
Set-GitHubRepositoryCustomProperty—PATCH /repos/{owner}/{repo}/properties/values(create/update/remove values on a repo). Pipeline-friendly withGet-GitHubRepositoryCustomProperty.Organization property schema (allowed values / definitions)
Get-GitHubOrganizationCustomProperty—GET /orgs/{org}/properties/schemaand.../schema/{name}Set-GitHubOrganizationCustomProperty—PUT /orgs/{org}/properties/schema/{name}Remove-GitHubOrganizationCustomProperty—DELETE /orgs/{org}/properties/schema/{name}Set-GitHubOrganizationCustomPropertyValue—PATCH /orgs/{org}/properties/values(bulk-assign values across repos)Enterprise property schema (allowed values / definitions)
Get-GitHubEnterpriseCustomProperty—GET /enterprises/{enterprise}/properties/schemaand.../schema/{name}Set-GitHubEnterpriseCustomProperty—PUT /enterprises/{enterprise}/properties/schema/{name}Remove-GitHubEnterpriseCustomProperty—DELETE /enterprises/{enterprise}/properties/schema/{name}(Names are suggestions — happy to align with the module's conventions.)
Notes / considerations
admin:enterpriseis required. The cmdlets should work with whichever-Contexttoken is supplied and surface a clear error when the token lacks scope, rather than silently failing.-WhatIf/SupportsShouldProcessso callers can preview changes (Custo diffs current vs desired before writing).single_select/multi_select/string/true_falsevalue types,allowed_values,values_editable_by,required,default_value.References