-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdown.ps1
More file actions
27 lines (23 loc) · 684 Bytes
/
Copy pathdown.ps1
File metadata and controls
27 lines (23 loc) · 684 Bytes
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
$topologyArray = "xp0", "xp1", "xm1";
$startDirectory = ".\run\sitecore-";
$workinDirectoryPath;
$envCheck;
$envCheckVariable = "HOST_LICENSE_FOLDER";
foreach ($topology in $topologyArray) {
$envCheck = Get-Content (Join-Path -Path ($startDirectory + $topology) -ChildPath .env) -Encoding UTF8 | Where-Object { $_ -imatch "^$envCheckVariable=.+" }
if ($envCheck) {
$workinDirectoryPath = $startDirectory + $topology;
break
}
}
Push-Location $workinDirectoryPath
Write-Host "Down containers..." -ForegroundColor Green
try {
docker-compose down
if ($LASTEXITCODE -ne 0) {
Write-Error "Container down failed, see errors above."
}
}
finally {
Pop-Location
}