Commit 1e1baff 1 parent 2e3bd3e commit 1e1baff Copy full SHA for 1e1baff
File tree 2 files changed +13
-12
lines changed
2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,11 @@ param(
32
32
[string ] $AdminUser ,
33
33
[Parameter (Mandatory )]
34
34
[string ] $AdminUserPwd ,
35
- [string ] $AgentPool = " AgentPool"
35
+ [Parameter (Mandatory )]
36
+ [string ] $AgentPool ,
37
+ [Parameter (Mandatory )]
38
+ [ValidateScript ({Test-Path $_ - PathType Container})]
39
+ [string ] $DownloadFolder
36
40
)
37
41
38
42
Set-StrictMode - Version Latest
@@ -48,7 +52,7 @@ Logit -indent "PAT $($PAT[0]+"*"*$PAT.Length)"
48
52
Logit - indent " AdminUserPwd $ ( $AdminUserPwd [0 ]+ " *" * $AdminUserPwd.Length ) "
49
53
Logit - indent " Folder is $Folder "
50
54
51
- $fname = (Get-Item (Join-Path $PSScriptRoot " vsts-agent*.zip" )).FullName
55
+ $fname = (Get-Item (Join-Path $DownloadFolder " vsts-agent*.zip" )).FullName
52
56
Logit - indent " fname is $fname "
53
57
54
58
Expand-Archive - Path $fname - DestinationPath $Folder - Force
Original file line number Diff line number Diff line change @@ -107,17 +107,14 @@ Set-Location $Folder
107
107
108
108
if ( Test-Path .\BootcampScripts )
109
109
{
110
- LogIt " .\BootcampScripts exists, pulling"
111
- Set-Location .\BootcampScripts
112
- git pull 2>&1
113
- }
114
- else
115
- {
116
- LogIt " .\BootcampScripts does not exist, cloning"
117
- git clone https:// github.com / ClearMeasure/ BootcampScripts.git 2>&1
118
- Set-Location .\BootcampScripts
110
+ LogIt " .\BootcampScripts exists, removing it"
111
+ Remove-Item .\BootcampScripts - Recurse - Force - ErrorAction Ignore
119
112
}
120
113
114
+ LogIt " Cloning BootcampScripts"
115
+ git clone https:// github.com / ClearMeasure/ BootcampScripts.git 2>&1
116
+ Set-Location .\BootcampScripts
117
+
121
118
$ErrorActionPreference = " Stop"
122
119
123
120
try {
@@ -128,7 +125,7 @@ try {
128
125
129
126
if ( ! $SkipVsts )
130
127
{
131
- .\Add-VstsAgent.ps1 - LogFile $logFile - AccountUrl $AccountUrl - PAT $PAT - AdminUser $AdminUserName - AdminUserPwd $AdminUserPwd - AgentPool $AgentPool
128
+ .\Add-VstsAgent.ps1 - LogFile $logFile - AccountUrl $AccountUrl - PAT $PAT - AdminUser $AdminUserName - AdminUserPwd $AdminUserPwd - AgentPool $AgentPool - DownloadFolder $PSScriptRoot
132
129
}
133
130
134
131
if ( ! $SkipSql )
You can’t perform that action at this time.
0 commit comments