Get a list of Azure DevOps Pipeline Environments within a specified project.
Get-AdoEnvironment [[-CollectionUri] <string>] [[-ProjectName] <string>] [[-Name] <string>] [[-Top] <int32>] [[-Version] <string>] [<CommonParameters>]
Get-AdoEnvironment [[-CollectionUri] <string>] [[-ProjectName] <string>] [-Id] <int32>
[[-Expands] <string>] [[-Version] <string>] [<CommonParameters>]
This cmdlet has the following aliases,
- N/A
This cmdlet retrieves a list of Azure DevOps Pipeline Environments for a given project, with optional filtering by environment name and pagination support.
$params = @{
CollectionUri = 'https://dev.azure.com/my-org'
ProjectName = 'my-project-1'
}
Get-AdoEnvironment @params -Top 2
Get-AdoEnvironment @params -Name 'my-environment-tst'
Get-AdoEnvironment @params -Name '*environment*'
Get-AdoEnvironment @params -Name 'my-env*' -Top 2Retrieves environments from the specified project with various filtering and pagination options.
$params = @{
CollectionUri = 'https://dev.azure.com/my-org'
ProjectName = 'my-project-1'
}
@(
'my-environment-tst',
'my-environment-dev'
) | Get-AdoEnvironment @params -VerboseRetrieves the specified environments from the project, demonstrating pipeline input.
Optional. The collection URI of the Azure DevOps collection/organization, e.g., https://dev.azure.com/my-org.
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 name or id of the project.
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: ''Optional. The name of the environment to filter the results. Supports wildcard patterns.
Type: System.String
DefaultValue: ''
SupportsWildcards: true
Aliases: []
ParameterSets:
- Name: ListEnvironments
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Optional. The maximum number of environments to return.
Type: System.Int32
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ListEnvironments
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Optional. The ID of a specific environment to retrieve.
Type: System.Int32
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ByEnvironmentId
Position: Named
IsRequired: false
ValueFromPipeline: true
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''Optional. Include additional details in the returned objects. Valid values are 'none' and 'resourceReferences'. Default is 'none'.
Type: System.String
DefaultValue: none
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ByEnvironmentId
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues:
- none
- resourceReferences
HelpMessage: ''Optional. The API version to use for the request. Default is '7.2-preview.1'.
Type: System.String
DefaultValue: 7.2-preview.1
SupportsWildcards: false
Aliases:
- ApiVersion
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues:
- 7.2-preview.1
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
- Requires authentication to Azure DevOps. Use
Set-AdoDefaultto configure default organization and project values. - The cmdlet automatically retrieves authentication through
Invoke-AdoRestMethodwhich callsNew-AdoAuthHeader.