Skip to content

Latest commit

 

History

History
266 lines (208 loc) · 5.7 KB

File metadata and controls

266 lines (208 loc) · 5.7 KB

Get-AdoRepository

SYNOPSIS

Retrieves Azure DevOps repository details.

SYNTAX

ListRepositories

Get-AdoRepository [[-CollectionUri] <string>] [[-ProjectName] <string>] [-IncludeLinks] [-IncludeHidden] [-IncludeAllUrls] [[-Version] <string>] [<CommonParameters>]

ByNameOrId

Get-AdoRepository [[-CollectionUri] <string>] [[-ProjectName] <string>] [[-Name] <string>] [[-Version] <string>] [<CommonParameters>]

ALIASES

This cmdlet has the following aliases,

  • N/A

DESCRIPTION

This cmdlet retrieves details of one or more Azure DevOps repositories within a specified project. You can retrieve all repositories, or specific repositories by name or ID.

EXAMPLES

EXAMPLE 1

PowerShell

$params = @{
    CollectionUri = 'https://dev.azure.com/my-org'
    ProjectName   = 'my-project-1'
}
Get-AdoRepository @params

Retrieves all repositories from the specified project.

EXAMPLE 2

PowerShell

$params = @{
    CollectionUri = 'https://dev.azure.com/my-org'
    ProjectName   = 'my-project-1'
    Name          = 'my-repository-1'
}
Get-AdoRepository @params

Retrieves the specified repository from the project.

EXAMPLE 3

PowerShell

Get-AdoRepository -Name 'my-repository-1'

Retrieves a specific repository using the default collection URI and project name from environment variables.

PARAMETERS

-CollectionUri

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

-ProjectName

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

-Name

Optional. The ID or name of the repository(s) to retrieve. If not provided, retrieves all repositories.

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

-IncludeLinks

Optional switch. Include additional links in the response.

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

-IncludeHidden

Optional switch. Include hidden repositories in the response.

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

-IncludeAllUrls

Optional switch. Include all URLs in the response.

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

-Version

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

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

PSCustomObject

NOTES

  • 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.
  • If a repository is not found, a warning is displayed and the cmdlet continues processing.

RELATED LINKS