Set-GitHubOrganization

SYNOPSIS

Update an organization

SYNTAX

__AllParameterSets

Set-GitHubOrganization [-Org] <string> [-BillingEmail <string>] [-Company <string>]
 [-Email <string>] [-TwitterUsername <string>] [-Location <string>] [-Name <string>]
 [-Description <string>] [-HasOrganizationProjects] [-HasRepositoryProjects]
 [-DefaultRepositoryPermission <string>] [-MembersCanCreateRepositories]
 [-MembersCanCreateInternalRepositories] [-MembersCanCreatePrivateRepositories]
 [-MembersCanCreatePublicRepositories] [-MembersAllowedRepositoryCreationType <string>]
 [-MembersCanCreatePages] [-MembersCanCreatePublicPages] [-MembersCanCreatePrivatePages]
 [-MembersCanForkPrivateRepositories] [-WebCommitSignoffRequired] [-Blog <string>]
 [-AdvancedSecurityEnabledForNewRepositories] [-DependabotAlertsEnabledForNewRepositories]
 [-DependabotSecurityUpdatesEnabledForNewRepositories] [-DependencyGraphEnabledForNewRepositories]
 [-SecretScanningEnabledForNewRepositories] [-SecretScanningPushProtectionEnabledForNewRepositories]
 [-SecretScanningPushProtectionCustomLink <string>] [-DeployKeysEnabledForRepositories]
 [-Body <Object>] [-Accept <string>] [-WhatIf] [-Confirm]

ALIASES

This cmdlet has the following aliases,

  • Get-GHSetOrganization

DESCRIPTION

The Set-GitHubOrganization cmdlet invokes the PATCH method of the /orgs/{org} endpoint (Update an organization)

[!WARNING] Closing down notice: GitHub will replace and discontinue ‘members_allowed_repository_creation_type’ in favor of more granular permissions. The new input parameters are ‘members_can_create_public_repositories’, ‘members_can_create_private_repositories’ for all organizations and ‘members_can_create_internal_repositories’ for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the blog post (https://developer.github.com/changes/2019-12-03-internal-visibility-changes). [!WARNING] Closing down notice: Code security product enablement for new repositories through the organization API is closing down. Please use code security configurations (https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the changelog (https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/).

Updates the organization’s profile and member privileges.

The authenticated user must be an organization owner to use this endpoint.

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

Endpoint: PATCH /orgs/{org} API version: 2026-03-10

EXAMPLES

EXAMPLE 1

Set-GitHubOrganization -Org 'github'

Invokes PATCH /orgs/{org}

EXAMPLE 2

Set-GitHubOrganization -Org 'github' -Body @{ billing_email = 'mona@github.com' }

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: ''

-AdvancedSecurityEnabledForNewRepositories

Endpoint closing down notice. Please use code security configurations (https://docs.github.com/rest/code-security/configurations) instead.

Whether GitHub Advanced Security is automatically enabled for new repositories and repositories transferred to this organization.

To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see “Managing security managers in your organization (https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).”

You can check which security and analysis features are currently enabled by using a ‘GET /orgs/{org}’ request.

Body property [ advanced_security_enabled_for_new_repositories ]

This property is deprecated

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: ''

-BillingEmail

Billing email address. This address is not publicized.

Body property [ billing_email ]

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

-Blog

The blog value of the request

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: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Company

The company 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: ''

-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: ''

-DefaultRepositoryPermission

Default permission level members have for organization repositories.

Body property [ default_repository_permission ]

Default value: read

Allowed values: ‘read’, ‘write’, ‘admin’, ‘none’

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

-DependabotAlertsEnabledForNewRepositories

Endpoint closing down notice. Please use code security configurations (https://docs.github.com/rest/code-security/configurations) instead.

Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to this organization.

To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see “Managing security managers in your organization (https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).”

You can check which security and analysis features are currently enabled by using a ‘GET /orgs/{org}’ request.

Body property [ dependabot_alerts_enabled_for_new_repositories ]

This property is deprecated

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: ''

-DependabotSecurityUpdatesEnabledForNewRepositories

Endpoint closing down notice. Please use code security configurations (https://docs.github.com/rest/code-security/configurations) instead.

Whether Dependabot security updates are automatically enabled for new repositories and repositories transferred to this organization.

To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see “Managing security managers in your organization (https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).”

You can check which security and analysis features are currently enabled by using a ‘GET /orgs/{org}’ request.

Body property [ dependabot_security_updates_enabled_for_new_repositories ]

This property is deprecated

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: ''

-DependencyGraphEnabledForNewRepositories

Endpoint closing down notice. Please use code security configurations (https://docs.github.com/rest/code-security/configurations) instead.

Whether dependency graph is automatically enabled for new repositories and repositories transferred to this organization.

To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see “Managing security managers in your organization (https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).”

You can check which security and analysis features are currently enabled by using a ‘GET /orgs/{org}’ request.

Body property [ dependency_graph_enabled_for_new_repositories ]

This property is deprecated

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: ''

-DeployKeysEnabledForRepositories

Controls whether or not deploy keys may be added and used for repositories in the organization.

Body property [ deploy_keys_enabled_for_repositories ]

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: ''

-Description

The description of the company. The maximum size is 160 characters.

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

-Email

The publicly visible email address.

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

-HasOrganizationProjects

Whether an organization can use organization projects.

Body property [ has_organization_projects ]

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: ''

-HasRepositoryProjects

Whether repositories that belong to the organization can use repository projects.

Body property [ has_repository_projects ]

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: ''

-Location

The location.

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

-MembersAllowedRepositoryCreationType

Specifies which types of repositories non-admin organization members can create. ‘private’ is only available to repositories that are part of an organization on GitHub Enterprise Cloud. Note: This parameter is closing down and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in ‘members_can_create_repositories’. See the parameter deprecation notice in the operation description for details.

Body property [ members_allowed_repository_creation_type ]

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

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

-MembersCanCreateInternalRepositories

Whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see “Restricting repository creation in your organization (https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)” in the GitHub Help documentation.

Body property [ members_can_create_internal_repositories ]

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: ''

-MembersCanCreatePages

Whether organization members can create GitHub Pages sites. Existing published sites will not be impacted.

Body property [ members_can_create_pages ]

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: ''

-MembersCanCreatePrivatePages

Whether organization members can create private GitHub Pages sites. Existing published sites will not be impacted.

Body property [ members_can_create_private_pages ]

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: ''

-MembersCanCreatePrivateRepositories

Whether organization members can create private repositories, which are visible to organization members with permission. For more information, see “Restricting repository creation in your organization (https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)” in the GitHub Help documentation.

Body property [ members_can_create_private_repositories ]

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: ''

-MembersCanCreatePublicPages

Whether organization members can create public GitHub Pages sites. Existing published sites will not be impacted.

Body property [ members_can_create_public_pages ]

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: ''

-MembersCanCreatePublicRepositories

Whether organization members can create public repositories, which are visible to anyone. For more information, see “Restricting repository creation in your organization (https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)” in the GitHub Help documentation.

Body property [ members_can_create_public_repositories ]

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: ''

-MembersCanCreateRepositories

Whether of non-admin organization members can create repositories. Note: A parameter can override this parameter. See ‘members_allowed_repository_creation_type’ in this table for details.

Body property [ members_can_create_repositories ]

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: ''

-MembersCanForkPrivateRepositories

Whether organization members can fork private organization repositories.

Body property [ members_can_fork_private_repositories ]

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: ''

-Name

The shorthand name of the company.

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: ''

-SecretScanningEnabledForNewRepositories

Endpoint closing down notice. Please use code security configurations (https://docs.github.com/rest/code-security/configurations) instead.

Whether secret scanning is automatically enabled for new repositories and repositories transferred to this organization.

To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see “Managing security managers in your organization (https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).”

You can check which security and analysis features are currently enabled by using a ‘GET /orgs/{org}’ request.

Body property [ secret_scanning_enabled_for_new_repositories ]

This property is deprecated

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: ''

If ‘secret_scanning_push_protection_custom_link_enabled’ is true, the URL that will be displayed to contributors who are blocked from pushing a secret.

Body property [ secret_scanning_push_protection_custom_link ]

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

-SecretScanningPushProtectionEnabledForNewRepositories

Endpoint closing down notice. Please use code security configurations (https://docs.github.com/rest/code-security/configurations) instead.

Whether secret scanning push protection is automatically enabled for new repositories and repositories transferred to this organization.

To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see “Managing security managers in your organization (https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization).”

You can check which security and analysis features are currently enabled by using a ‘GET /orgs/{org}’ request.

Body property [ secret_scanning_push_protection_enabled_for_new_repositories ]

This property is deprecated

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: ''

-TwitterUsername

The Twitter username of the company.

Body property [ twitter_username ]

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

-WebCommitSignoffRequired

Whether contributors to organization repositories are required to sign off on commits they make through GitHub’s web interface.

Body property [ web_commit_signoff_required ]

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: ''

-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: ''

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: orgs/update Category: orgs / orgs