forked from CoolDadTx/p3net-tfsmigrate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRunAll.ps1
96 lines (78 loc) · 2.94 KB
/
RunAll.ps1
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
$logPath = "C:\temp"
$migratePath = "C:\Migration"
function Confirm ( [string] $message )
{
do
{
$input = Read-Host -prompt "$message (Y/N)? "
if ($input -Like 'Y') { return $true }
elseif ($input -Like 'N') { return $false }
} while (true);
}
$postMigrateSteps = @()
cd $migratePath
# 1
if (-Not (Confirm('New project created'))) { exit }
$postMigrateSteps += "Add customized image"
# 2
if (-Not (Confirm('Process template customized'))) { exit }
# 3 - Code
if (Confirm('Migrate source code'))
{
.\tfsmigrate.exe -processor VersionControl -logFile "$logPath\VersionControl.log" -verbose
$postMigrateSteps += "Add root files"
$postMigrateSteps += "Lock source code"
}
# 4 - Work items
if (Confirm('Migrate work items'))
{
if (Confirm('Work items have been cleared') -and Confirm('Member of project Collection Service Accounts and has package management rights') -and Confirm('notifications for Work items disabled'))
{
.\tfsmigrate.exe -processor WorkItemTracking -logFile "$logpath\WorkItemTracking.log" -verbose
$postMigrateSteps += "Set default iteration"
$postMigrateSteps += "Set default area"
$postMigrateSteps += "Lock work items"
$postMigrateSteps += "Turn on notifications for Work items"
}
}
# 5 - Extensions
$postMigrateSteps += "Install custom extensions"
# 6 - Queries
if (Confirm('Migrate queries (Y/N)?'))
{
if (Confirm('queries have been cleared'))
{
.\tfsmigrate.exe -processor QueryManagement -logFile "$logpath\QueryManagement.log" -verbose
$postMigrateSteps += "Confirm migration of queries that cannot be automatically migrated"
}
}
# 7 - Dashboard
$postMigrateSteps += "Overview dashboard configured"
# 8 - Packages
if (Confirm('Migrate packages'))
{
if (Confirm('Created package feed') -and Confirm('Updated settings file') - and Confirm('Added package source to command line'))
{
.\tfsmigrate.exe -processor PackageManagement -logFile "$logpath\PackageManagement.log" -verbose
$postMigrateSteps += "Tag packages"
}
}
# 9 - Build Definitions
if (Confirm('Migrate build definitions'))
{
if (Confirm('Imported task groups') -and Confirm('Updated settings with task group IDs'))
{
.\tfsmigrate.exe -processor BuildManagement -logFile "$logpath\BuildManagement.log" -verbose
$postMigrateSteps += "Fix source paths"
$postMigrateSteps += "Schedule builds"
}
}
# 10 - Security
$postMigrateSteps += "Set up groups"
$postMigrateSteps += "Assign permissions and access levels"
$postMigrateSteps += "Configure notifications"
$postMigrateSteps += "Remove users from Service Accounts (tfssecurity /g- \"project Collection Service Accounts\" users /Collection:https://myaccount.visualstudio.com)"
# 11 - Post Migration
foreach ($msg in $postMigrateSteps) {
Read-Host -Prompt $msg
}