Skip to content

Latest commit

 

History

History
263 lines (210 loc) · 5.25 KB

File metadata and controls

263 lines (210 loc) · 5.25 KB

New-AdoProject

SYNOPSIS

Create a new project in an Azure DevOps organization.

SYNTAX

__AllParameterSets

New-AdoProject [[-CollectionUri] <string>] [-Name] <string[]> [[-Description] <string>]
 [[-Process] <string>] [[-SourceControl] <string>] [[-Visibility] <string>] [[-Version] <string>]
 [<CommonParameters>]

ALIASES

This cmdlet has the following aliases,

  • N/A

DESCRIPTION

This cmdlet creates a new Azure DevOps project within a specified organization. When a project with the specified name already exists, it will be returned instead of creating a new one.

EXAMPLES

EXAMPLE 1

PowerShell

$params = @{
    CollectionUri = 'https://dev.azure.com/my-org'
    Name          = 'my-project-1'
    Description   = 'My new project'
}
New-AdoProject @params -Verbose

Creates a new project in the specified organization.

EXAMPLE 2

PowerShell

$params = @{
    CollectionUri = 'https://dev.azure.com/my-org'
}
@('my-project-1', 'my-project-2') | New-AdoProject @params -Verbose

Creates multiple projects demonstrating pipeline input.

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

-Name

Mandatory. The name of the project to create.

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

-Description

The description of the project.

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

-Process

The process template to use for the project. Default is 'Agile'.

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

-SourceControl

The source control type to use for the project. Default is 'Git'.

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

-Visibility

The visibility of the project. Default is 'Private'.

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

-Version

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.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

  • System.String

OUTPUTS

PSCustomObject

NOTES

  • The cmdlet automatically polls for project creation completion before returning

  • If a project with the same name already exists, it returns the existing project instead of throwing an error

  • Requires ShouldProcess confirmation due to ConfirmImpact = 'High'

  • 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