forked from renz45/CSharp-GradeBookApplication
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSuccess.ps1
More file actions
40 lines (33 loc) · 1.65 KB
/
Success.ps1
File metadata and controls
40 lines (33 loc) · 1.65 KB
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
$env:GIT_REDIRECT_STDERR = '2>&1'
git config --global user.email $($env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL)
git config --global user.name $($env:APPVEYOR_REPO_COMMIT_AUTHOR)
#git clone https://dev:$($env:git_creds)@totaltestltd.visualstudio.com/SampleProject/_git/SampleProject C:\projects\atata
git clone --branch=testi https://dev:$($env:git_creds)@dev.azure.com/totaltestltd/SampleProject/_git/SampleProject C:\projects\atata
git remote remove origin
#git remote add origin https://totaltestltd@totaltestltd.visualstudio.com/SampleProject/_git/SampleProject
git remote add origin https://totaltestltd@dev.azure.com/totaltestltd/SampleProject/_git/SampleProject
cd C:\projects\atata
git branch
git checkout -b testo
git push -u origin testo
if ($LASTEXITCODE -ne 0) {
Write-Host -ForegroundColor Yellow 'LASTEXITCODE=' $LASTEXITCODE;
exit $LASTEXITCODE
}
#$urlvsts = "https://dev.azure.com/totaltestltd/Total%20Test/_apis/build/builds?api-version=6.1-preview.6"
#$token = "7zoj7msfjzews5kkjrwd3gu65i4ldvqmnr3d34tfrtvpvhqo7xqq"
#$encodedPat = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes( ":$token"))
##$body = '{
## "definition": {
## "id": "7"
## },
## "sourceBranch": "main",
## "reason": "individualCI",
## "templateParameters": {
## "AnotherParameter": "new"
## }
##}'
#
#$body = '{ "definition": { "id": "7" }, "sourceBranch": "main", "reason": "individualCI", "templateParameters": { "AnotherParameter": "new" } }'
#
#Invoke-WebRequest $urlvsts -Method Post -Headers @{Authorization = "Basic $encodedPat"} -Body $body -ContentType "application/json" -UseBasicParsing