forked from StartAutomating/PSDevOps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Get-BuildStep.ps1
52 lines (46 loc) · 1.43 KB
/
Get-BuildStep.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
function Get-BuildStep
{
<#
.Synopsis
Gets BuildSteps
.Description
Gets Build Steps.
Build Steps are scripts or data fragments used to compose a build.
.Example
Get-BuildStep
.Link
Import-BuildStep
#>
[OutputType('PSDevOps.BuildStep')]
param(
# If provided, only return build steps that are like this name.
[Parameter(ValueFromPipelineByPropertyName)]
[string]
$Name,
# If provided, only return build steps matching this extension.
[Parameter(ValueFromPipelineByPropertyName)]
[string]
$Extension,
# If provided, only return build steps of a given type.
[Parameter(ValueFromPipelineByPropertyName)]
[string]
$Type,
# If provided, only return build steps for a given build system.
[Parameter(ValueFromPipelineByPropertyName)]
[string]
$BuildSystem
)
process {
#region Get Matching Build Steps
foreach ($v in $script:ComponentMetaData.Values) {
foreach ($val in $v.Values) {
if ($Name -and $val.Name -notlike $name) { continue}
if ($Extension -and $val.Extension -notlike $Extension) { continue }
if ($Type -and $val.Type -notlike $Type) { continue }
if ($BuildSystem -and $val.BuildSystem -notlike $BuildSystem) { continue }
$val
}
}
#region Get Matching Build Steps
}
}