New-GitHubPrivateRegistryOrgPrivateRegistry

SYNOPSIS

Create a private registry for an organization

SYNTAX

Default (Default)

New-GitHubPrivateRegistryOrgPrivateRegistry [-Org] <string> -RegistryType <string> -Url <string>
 -Visibility <string> [-Username <string>] [-ReplacesBase] [-EncryptedValue <string>]
 [-KeyId <string>] [-SelectedRepositoryIds <long[]>] [-AuthType <string>] [-TenantId <string>]
 [-ClientId <string>] [-AwsRegion <string>] [-AccountId <string>] [-RoleName <string>]
 [-Domain <string>] [-DomainOwner <string>] [-JfrogOidcProviderName <string>] [-Audience <string>]
 [-IdentityMappingName <string>] [-Namespace <string>] [-ServiceSlug <string>] [-ApiHost <string>]
 [-WorkloadIdentityProvider <string>] [-ServiceAccount <string>] [-Accept <string>] [-WhatIf]
 [-Confirm]

Body

New-GitHubPrivateRegistryOrgPrivateRegistry [-Org] <string> -Body <Object> [-RegistryType <string>]
 [-Url <string>] [-Visibility <string>] [-Username <string>] [-ReplacesBase]
 [-EncryptedValue <string>] [-KeyId <string>] [-SelectedRepositoryIds <long[]>] [-AuthType <string>]
 [-TenantId <string>] [-ClientId <string>] [-AwsRegion <string>] [-AccountId <string>]
 [-RoleName <string>] [-Domain <string>] [-DomainOwner <string>] [-JfrogOidcProviderName <string>]
 [-Audience <string>] [-IdentityMappingName <string>] [-Namespace <string>] [-ServiceSlug <string>]
 [-ApiHost <string>] [-WorkloadIdentityProvider <string>] [-ServiceAccount <string>]
 [-Accept <string>] [-WhatIf] [-Confirm]

ALIASES

This cmdlet has the following aliases,

  • Get-GHNewPrivateRegistryOrgPrivateRegistry

DESCRIPTION

The New-GitHubPrivateRegistryOrgPrivateRegistry cmdlet invokes the POST method of the /orgs/{org}/private-registries endpoint (Create a private registry for an organization)

Creates a private registry configuration with an encrypted value for an organization. Encrypt your secret using LibSodium (https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see “Encrypting secrets for the REST API (https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api).” For OIDC-based registries (‘oidc_azure’, ‘oidc_aws’, ‘oidc_jfrog’, ‘oidc_cloudsmith’, or ‘oidc_gcp’), the ‘encrypted_value’ and ‘key_id’ fields should be omitted. For anonymous registries (‘anonymous’), the ‘username’, ‘encrypted_value’, and ‘key_id’ fields must be omitted.

OAuth app tokens and personal access tokens (classic) need the ‘admin:org’ scope to use this endpoint.

Endpoint: POST /orgs/{org}/private-registries API version: 2026-03-10

EXAMPLES

EXAMPLE 1

New-GitHubPrivateRegistryOrgPrivateRegistry -Org 'github' -RegistryType 'maven_repository' -Url 'https://maven.pkg.github.com/organization/' -Visibility 'all' -Body @{ key = 'value' }

Invokes POST /orgs/{org}/private-registries

EXAMPLE 2

New-GitHubPrivateRegistryOrgPrivateRegistry -Org 'github' -Body @{ registry_type = 'maven_repository' }

Sends the request body from a hashtable, parameters override the keys of -Body

PARAMETERS

-Accept

The Accept header (media type) of the request Default value: application/vnd.github+json

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-AccountId

The AWS account ID. Required when ‘auth_type’ is ‘oidc_aws’.

Body property [ account_id ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-ApiHost

The Cloudsmith API host. Optional for ‘oidc_cloudsmith’ auth type. If omitted, ‘api.cloudsmith.io’ is used by default.

Body property [ api_host ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Audience

The OIDC audience. Optional for ‘oidc_aws’, ‘oidc_jfrog’, and ‘oidc_gcp’, and required for ‘oidc_cloudsmith’ auth types.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-AuthType

The authentication type for the private registry. Defaults to ‘token’ if not specified. Use ‘oidc_azure’, ‘oidc_aws’, ‘oidc_jfrog’, ‘oidc_cloudsmith’, or ‘oidc_gcp’ for OIDC authentication. Use ‘anonymous’ for registries that do not require authentication; ‘username’, ‘encrypted_value’, and ‘key_id’ must be omitted.

Body property [ auth_type ]

Allowed values: ‘token’, ‘username_password’, ‘oidc_azure’, ‘oidc_aws’, ‘oidc_jfrog’, ‘oidc_cloudsmith’, ‘oidc_gcp’, ‘anonymous’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-AwsRegion

The AWS region. Required when ‘auth_type’ is ‘oidc_aws’.

Body property [ aws_region ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Body

The whole request body as a hashtable or object. Keys that are also available as parameters are overwritten by the parameter values

Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Body
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-ClientId

The client ID of the Azure AD application. Required when ‘auth_type’ is ‘oidc_azure’.

Body property [ client_id ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- cf
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Domain

The CodeArtifact domain. Required when ‘auth_type’ is ‘oidc_aws’.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-DomainOwner

The CodeArtifact domain owner (AWS account ID). Required when ‘auth_type’ is ‘oidc_aws’.

Body property [ domain_owner ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-EncryptedValue

The value for your secret, encrypted with LibSodium (https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the Get private registries public key for an organization (https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization) endpoint. Required when ‘auth_type’ is ‘token’ or ‘username_password’. Should be omitted for OIDC auth types.

Body property [ encrypted_value ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-IdentityMappingName

The JFrog identity mapping name. Optional for ‘oidc_jfrog’ auth type.

Body property [ identity_mapping_name ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-JfrogOidcProviderName

The JFrog OIDC provider name. Required when ‘auth_type’ is ‘oidc_jfrog’.

Body property [ jfrog_oidc_provider_name ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-KeyId

The ID of the key you used to encrypt the secret. Required when ‘auth_type’ is ‘token’ or ‘username_password’. Should be omitted for OIDC auth types.

Body property [ key_id ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Namespace

The Cloudsmith organization namespace. Required when ‘auth_type’ is ‘oidc_cloudsmith’.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Org

The organization name. The name is not case sensitive.

Path parameter [ org ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-RegistryType

The registry type.

Required unless -Body is used

Body property [ registry_type ]

Allowed values: ‘maven_repository’, ‘nuget_feed’, ‘goproxy_server’, ‘npm_registry’, ‘rubygems_server’, ‘cargo_registry’, ‘composer_repository’, ‘docker_registry’, ‘git_source’, ‘helm_registry’, ‘hex_organization’, ‘hex_repository’, ‘pub_repository’, ‘python_index’, ‘terraform_registry’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Body
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
- Name: Default
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-ReplacesBase

Whether this private registry should replace the base registry (e.g., npmjs.org for npm, rubygems.org for rubygems). When set to ‘true’, Dependabot will only use this registry and will not fall back to the public registry. When set to ‘false’ (default), Dependabot will use this registry for scoped packages but may fall back to the public registry for other packages.

Body property [ replaces_base ]

Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-RoleName

The AWS IAM role name. Required when ‘auth_type’ is ‘oidc_aws’.

Body property [ role_name ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SelectedRepositoryIds

An array of repository IDs that can access the organization private registry. You can only provide a list of repository IDs when ‘visibility’ is set to ‘selected’. You can manage the list of selected repositories using the Update a private registry for an organization (https://docs.github.com/rest/private-registries/organization-configurations#update-a-private-registry-for-an-organization) endpoint. This field should be omitted if ‘visibility’ is set to ‘all’ or ‘private’.

Body property [ selected_repository_ids ]

Type: System.Int64[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-ServiceAccount

The GCP service account email to impersonate. Optional for ‘oidc_gcp’ auth type. If omitted, the federated token is used directly (direct WIF).

Body property [ service_account ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-ServiceSlug

The Cloudsmith service account slug. Required when ‘auth_type’ is ‘oidc_cloudsmith’.

Body property [ service_slug ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-TenantId

The tenant ID of the Azure AD application. Required when ‘auth_type’ is ‘oidc_azure’.

Body property [ tenant_id ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Url

The URL of the private registry.

Required unless -Body is used

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Body
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
- Name: Default
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Username

The username to use when authenticating with the private registry. This field should be omitted if the private registry does not require a username for authentication.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Visibility

Which type of organization repositories have access to the private registry. ‘selected’ means only the repositories specified by ‘selected_repository_ids’ can access the private registry.

Required unless -Body is used

Allowed values: ‘all’, ‘private’, ‘selected’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Body
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
- Name: Default
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-WhatIf

Runs the command in a mode that only reports what would happen without performing the actions.

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- wi
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-WorkloadIdentityProvider

The full resource name of the GCP Workload Identity Provider (e.g. ‘projects//locations/global/workloadIdentityPools//providers/'). Required when 'auth_type' is 'oidc_gcp'.

Body property [ workload_identity_provider ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

Objects with properties named like the path parameters can be piped to this function

{{ Fill in the Description }}

System.String

{{ Fill in the Description }}

OUTPUTS

The response of the GitHub API (objects

{{ Fill in the Description }}

NOTES

OperationId: private-registries/create-org-private-registry Category: private-registries / organization-configurations