Skip to content

Latest commit

 

History

History
217 lines (167 loc) · 4.99 KB

File metadata and controls

217 lines (167 loc) · 4.99 KB

Remove-AdoServiceEndpoint

SYNOPSIS

Removes an Azure DevOps service endpoint (service connection) from one or more projects.

SYNTAX

__AllParameterSets

Remove-AdoServiceEndpoint [[-CollectionUri] <string>] [-Id] <string> [-ProjectIds] <string[]>
 [-Deep] [[-Version] <string>] [-WhatIf] [-Confirm] [<CommonParameters>]

ALIASES

This cmdlet has the following aliases,

  • N/A

DESCRIPTION

This function removes a service endpoint (service connection) from one or more Azure DevOps projects. You can perform a deep deletion to also remove all associated pipeline resources.

EXAMPLES

EXAMPLE 1

PowerShell

$params = @{
    CollectionUri = 'https://dev.azure.com/myorg'
    Id            = '00000000-0000-0000-0000-000000000001'
    ProjectIds    = 'MyProject'
}
Remove-AdoServiceEndpoint @params

Removes the service endpoint from the specified project.

EXAMPLE 2

PowerShell

$params = @{
    Id         = '00000000-0000-0000-0000-000000000001'
    ProjectIds = @('Project1', 'Project2', 'Project3')
}
Remove-AdoServiceEndpoint @params

Removes the service endpoint from multiple projects.

EXAMPLE 3

PowerShell

Remove-AdoServiceEndpoint -Id '00000000-0000-0000-0000-000000000001' -ProjectIds 'MyProject' -Deep

Removes the service endpoint and all associated pipeline resources from the project.

PARAMETERS

-CollectionUri

Optional. The URI of the Azure DevOps collection or Azure DevOps Server. If not provided, it uses the default collection URI from $env:DefaultAdoCollectionUri.

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

-Id

Mandatory. The ID of the service endpoint to remove.

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

-ProjectIds

Mandatory. One or more project IDs from which to remove the service endpoint.

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

-Deep

Optional. If specified, performs a deep deletion to remove all associated pipeline resources.

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

-Version

Optional. The API version to use. Defaults to '7.1'.

Type: System.String
DefaultValue: 7.1
SupportsWildcards: false
Aliases:
- ApiVersion
- Api
ParameterSets:
- Name: (All)
  Position: 3
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues:
- 7.1
- 7.2-preview.4
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

  • N/A

OUTPUTS

  • None

NOTES

  • If the service endpoint is not found, a warning is displayed instead of throwing an error.
  • The cmdlet has a high impact confirmation level, so it prompts for confirmation by default unless -Confirm:$false is specified.
  • Multiple projects can be specified to remove the service endpoint from all of them in a single operation.
  • Supports ShouldProcess for WhatIf and Confirm parameters (high impact).
  • Requires authentication to Azure DevOps. Use Set-AdoDefault to configure default organization and project values.
  • The cmdlet automatically retrieves authentication through Invoke-AdoRestMethod which calls New-AdoAuthHeader.

RELATED LINKS