Set-GitHubTeamLegacy

SYNOPSIS

Update a team (Legacy)

SYNTAX

Default (Default)

Set-GitHubTeamLegacy [-TeamId] <long> -Name <string> [-Description <string>] [-Privacy <string>]
 [-NotificationSetting <string>] [-Permission <string>] [-ParentTeamId <long>]
 [-ParentTeamSlug <string>] [-Accept <string>] [-WhatIf] [-Confirm]

Body

Set-GitHubTeamLegacy [-TeamId] <long> -Body <Object> [-Name <string>] [-Description <string>]
 [-Privacy <string>] [-NotificationSetting <string>] [-Permission <string>] [-ParentTeamId <long>]
 [-ParentTeamSlug <string>] [-Accept <string>] [-WhatIf] [-Confirm]

ALIASES

This cmdlet has the following aliases,

  • Get-GHSetTeamLegacy

DESCRIPTION

The Set-GitHubTeamLegacy cmdlet invokes the PATCH method of the /teams/{team_id} endpoint (Update a team (Legacy))

[!WARNING] Endpoint closing down notice: This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new Update a team (https://docs.github.com/rest/teams/teams#update-a-team) endpoint.

To edit a team, the authenticated user must either be an organization owner or a team maintainer. [!NOTE] With nested teams, the ‘privacy’ for parent teams cannot be ‘secret’.

Endpoint: PATCH /teams/{team_id} API version: 2026-03-10

EXAMPLES

EXAMPLE 1

Set-GitHubTeamLegacy -TeamId 1 -Name 'new team name' -Body @{ key = 'value' }

Invokes PATCH /teams/{team_id}

EXAMPLE 2

Set-GitHubTeamLegacy -TeamId 1 -Body @{ name = 'new team name' }

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

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

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

-Description

The description of the team.

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

-Name

The name of the team.

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

-NotificationSetting

The notification setting the team has chosen. Editing teams without specifying this parameter leaves ‘notification_setting’ intact. The options are:

  • ‘notifications_enabled’ - team members receive notifications when the team is @mentioned.
  • ‘notifications_disabled’ - no one receives notifications.

Body property [ notification_setting ]

Allowed values: ‘notifications_enabled’, ‘notifications_disabled’

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

-ParentTeamId

The ID of a team to set as the parent team.

Body property [ parent_team_id ]

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

-ParentTeamSlug

The slug of a team to set as the parent team. Ignored when ‘parent_team_id’ is also provided.

Body property [ parent_team_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: ''

-Permission

Closing down notice. The permission that new repositories will be added to the team with when none is specified.

Default value: pull

Allowed values: ‘pull’, ‘push’, ‘admin’

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

-Privacy

The level of privacy this team should have. Editing teams without specifying this parameter leaves ‘privacy’ intact. The options are: For a non-nested team:

  • ‘secret’ - only visible to organization owners and members of this team.
  • ‘closed’ - visible to all members of this organization. For a parent or child team:
  • ‘closed’ - visible to all members of this organization.

Allowed values: ‘secret’, ‘closed’

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

-TeamId

The unique identifier of the team.

Path parameter [ team_id ]

Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  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.Int64

{{ Fill in the Description }}

OUTPUTS

The response of the GitHub API (objects

{{ Fill in the Description }}

NOTES

OperationId: teams/update-legacy Category: teams / teams Deprecated: this endpoint is deprecated by GitHub