Skip to content

Latest commit

 

History

History
240 lines (189 loc) · 4.73 KB

File metadata and controls

240 lines (189 loc) · 4.73 KB

Set-AdoEnvironment

SYNOPSIS

Update an existing Azure DevOps Pipeline Environment.

SYNTAX

__AllParameterSets

Set-AdoEnvironment [[-CollectionUri] <string>] [[-ProjectName] <string>] [-Id] <int32>
 [-Name] <string> [[-Description] <string>] [[-Version] <string>] [<CommonParameters>]

ALIASES

This cmdlet has the following aliases,

  • N/A

DESCRIPTION

This cmdlet updates an existing Azure DevOps Pipeline Environment within a specified project.

EXAMPLES

EXAMPLE 1

PowerShell

$params = @{
    CollectionUri = 'https://dev.azure.com/my-org'
    ProjectName   = 'my-project-1'
    Id            = 1
    Name          = 'my-updated-environment'
    Description   = 'Updated environment description'
}
Set-AdoEnvironment @params -Verbose

Updates the environment with ID 1 in the specified project using the provided parameters.

EXAMPLE 2

PowerShell

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

[PSCustomObject]@{
    Id          = 1
    Name        = 'my-updated-environment'
    Description = 'Updated environment description'
} | Set-AdoEnvironment @params -Verbose

Updates the environment with ID 1 in the specified project using the provided parameters in a pipeline.

PARAMETERS

-CollectionUri

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

-ProjectName

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

-Id

Mandatory. The ID of the environment to update.

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

-Name

Optional. The name of the environment to update.

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

-Description

Optional. The description of the updated environment.

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

-Version

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

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.

RELATED LINKS