/
Get-ALTestSymbolsFromArtifact.ps1
41 lines (34 loc) · 1.31 KB
/
Get-ALTestSymbolsFromArtifact.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
function Get-ALTestSymbolsFromArtifact {
#Requires -Module BcContainerHelper
Param(
[Parameter(Mandatory)]
[string] $artifactUrl,
[Parameter(Mandatory = $false)]
[string] $folder,
[Parameter(Mandatory = $false)]
[switch] $createFolder
)
if ($createFolder) {
$null = New-Item -ItemType Directory -Path "$folder" -Force
}
$null = Import-Module -Name 'BcContainerHelper'
Download-Artifacts -artifactUrl $artifactUrl -includePlatform
$version = Split-Path (Split-Path $artifactUrl) -Leaf
$type = Split-Path (Split-Path (Split-Path $artifactUrl)) -Leaf
$defaultFolder = Resolve-Path "$($bcContainerHelperConfig.bcartifactsCacheFolder)\$type\$version\platform\Applications"
if (($null -eq $folder) -or ('' -eq $folder)) {
$folder = $defaultFolder
}
else {
$folder = Resolve-Path $folder
}
$sources = "$defaultFolder\testframework\", "$defaultFolder\BaseApp\Test\", "$defaultFolder\system application\Test\"
foreach ($source in $sources) {
$symbols = Get-ChildItem -Path $source -Recurse -Filter '*.app'
foreach ($symbol in $symbols) {
Write-Host "Copying $($symbol.FullName) to $folder" -ForegroundColor Green
Copy-Item -Path $symbol.FullName -Destination $folder -Force
}
}
return $folder
}