Skip to content

Commit 1e1baff

Browse files
committed
Updates for folder changes
1 parent 2e3bd3e commit 1e1baff

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

Add-VstsAgent.ps1

+6-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ param(
3232
[string] $AdminUser,
3333
[Parameter(Mandatory)]
3434
[string] $AdminUserPwd,
35-
[string] $AgentPool = "AgentPool"
35+
[Parameter(Mandatory)]
36+
[string] $AgentPool,
37+
[Parameter(Mandatory)]
38+
[ValidateScript({Test-Path $_ -PathType Container})]
39+
[string] $DownloadFolder
3640
)
3741

3842
Set-StrictMode -Version Latest
@@ -48,7 +52,7 @@ Logit -indent "PAT $($PAT[0]+"*"*$PAT.Length)"
4852
Logit -indent "AdminUserPwd $($AdminUserPwd[0]+"*"*$AdminUserPwd.Length)"
4953
Logit -indent "Folder is $Folder"
5054

51-
$fname = (Get-Item (Join-Path $PSScriptRoot "vsts-agent*.zip")).FullName
55+
$fname = (Get-Item (Join-Path $DownloadFolder "vsts-agent*.zip")).FullName
5256
Logit -indent "fname is $fname"
5357

5458
Expand-Archive -Path $fname -DestinationPath $Folder -Force

Initialize-BuildVM.ps1

+7-10
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,14 @@ Set-Location $Folder
107107

108108
if ( Test-Path .\BootcampScripts )
109109
{
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
119112
}
120113

114+
LogIt "Cloning BootcampScripts"
115+
git clone https://github.com/ClearMeasure/BootcampScripts.git 2>&1
116+
Set-Location .\BootcampScripts
117+
121118
$ErrorActionPreference = "Stop"
122119

123120
try {
@@ -128,7 +125,7 @@ try {
128125

129126
if ( !$SkipVsts )
130127
{
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
132129
}
133130

134131
if ( !$SkipSql )

0 commit comments

Comments
 (0)