Remove a repository from an Azure DevOps project.
Remove-AdoRepository [[-CollectionUri] <string>] [[-ProjectName] <string>] [-Name] <string> [[-Version] <string>] [<CommonParameters>]
This cmdlet has the following aliases,
- N/A
This cmdlet removes a repository from an Azure DevOps project through REST API.
$params = @{
CollectionUri = 'https://dev.azure.com/my-org'
ProjectName = 'my-project-1'
Name = 'my-repository-1'
}
Remove-AdoRepository @paramsRemoves the specified repository from the project.
Remove-AdoRepository -Name $repo.idRemoves a repository using its ID and the default collection URI and project name from environment variables.
Optional. The collection URI of the Azure DevOps collection/organization, e.g., https://dev.azure.com/my-org. Defaults to the value of $env:DefaultAdoCollectionUri.
Type: System.String
DefaultValue: $env:DefaultAdoCollectionUri
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Optional. The ID or name of the project. Defaults to the value of $env:DefaultAdoProject.
Type: System.String
DefaultValue: $env:DefaultAdoProject
SupportsWildcards: false
Aliases:
- ProjectId
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Mandatory. The repository ID or name to remove.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases:
- Id
- RepositoryId
ParameterSets:
- Name: (All)
Position: Named
IsRequired: true
ValueFromPipeline: true
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Optional. The API version to use for the request. Default is '7.1'.
Type: System.String
DefaultValue: '7.1'
SupportsWildcards: false
Aliases:
- ApiVersion
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues:
- '7.1'
- '7.2-preview.2'
HelpMessage: ''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.
- N/A
- None
- Requires authentication to Azure DevOps. Use
Set-AdoDefaultto configure default organization and project values. - The cmdlet automatically retrieves authentication through
Invoke-AdoRestMethodwhich callsNew-AdoAuthHeader. - If a repository is not found, a warning is displayed and the cmdlet continues processing.
- The cmdlet accepts either repository ID (GUID) or repository name.