File: gettingStarted.ps1

package info (click to toggle)
azure-devops-cli-extension 1.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 22,680 kB
  • sloc: python: 160,797; xml: 198; sh: 61; makefile: 56
file content (40 lines) | stat: -rw-r--r-- 1,348 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

param(
    [String]$org,
    [String]$projectName,
    [String]$repoName,
    [String]$repoToImport
)

if([string]::IsNullOrWhiteSpace($org))
{
    $org = Read-Host 'What is your organization? (ex: https://contoso.visualstudio.com/)'
}

if([string]::IsNullOrWhiteSpace($projectName))
{
    $projectName = Read-Host 'Please enter name of project to be used for bugbash'
}

$project = az devops project create --org $org --name $projectName -o json | ConvertFrom-Json
Write-Host "Created new project with Id $($project.id)" 

if([string]::IsNullOrWhiteSpace($repoName))
{
    $repoName = Read-Host "Please enter name of repo to be used for bugbash"
}

$repo = az repos create --org $org -p $project.id --name $repoName -o json | ConvertFrom-Json
Write-Host "Create repo with Id $($repo.id)"


if([string]::IsNullOrWhiteSpace($repoToImport))
{
    $repoToImport = Read-Host "Please give source of repo to import"
}

az repos import create --org $org -p $project.id -r $repo.id --git-url $repoToImport