Skip to content

Commit 5f36bb8

Browse files
author
Friedrich Weinmann
committed
docs update
1 parent d2ff81e commit 5f36bb8

File tree

6 files changed

+133
-11
lines changed

6 files changed

+133
-11
lines changed

PSModuleDevelopment/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## ???
44

5+
- New: Build Component - define build workflows based on pre-defined & extensible action code
56
- Fix: TemplateStore - default path iss invalid on MAC (#136)
67
- Fix: Invoke-PSMDTemplate - unreliable string replacement through -replace operator (#113)
78
- Fix: Publish-PSMDScriptFile - insufficient exclude paths (#138; @Callidus2000)

PSModuleDevelopment/functions/build/Get-PSMDBuildAction.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
function Get-PSMDBuildAction {
2+
<#
3+
.SYNOPSIS
4+
Get a list of registered build actions.
5+
6+
.DESCRIPTION
7+
Get a list of registered build actions.
8+
Actions are the scriptblocks that are used to execute the build logic when running Invoke-PSMDBuildProject.
9+
10+
.PARAMETER Name
11+
The name by which to filter the actions returned.
12+
Defaults to '*'
13+
14+
.EXAMPLE
15+
PS C:\> Get-PSMDBuildAction
16+
17+
Get a list of all registered build actions.
18+
#>
219
[CmdletBinding()]
320
param (
421
[PsfArgumentCompleter('PSModuleDevelopment.Build.Action')]

PSModuleDevelopment/functions/build/Get-PSMDBuildArtifact.ps1

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,36 @@
11
function Get-PSMDBuildArtifact {
2+
<#
3+
.SYNOPSIS
4+
Retrieve an artifact during a build project's execution.
5+
6+
.DESCRIPTION
7+
Retrieve an artifact during a build project's execution.
8+
These artifacts are usually created during such an execution and discarded once completed.
9+
10+
.PARAMETER Name
11+
The name by which to search for artifacts.
12+
Defaults to '*'
13+
14+
.PARAMETER Tag
15+
Search for artifacts by tag.
16+
Artifacts can receive tag for better categorization.
17+
When specifying multiple tags, any artifact containing at least one of them will be returned.
18+
19+
.EXAMPLE
20+
PS C:\> Get-PSMDBuildArtifact
21+
22+
List all available artifacts.
23+
24+
.EXAMPLE
25+
PS C:\> Get-PSMDBuildArtifact -Name ReleasePath
26+
27+
Returns the artifact named "ReleasePath"
28+
29+
.EXAMPLE
30+
PS C:\> Get-PSMDBuildArtifact -Tag pssession
31+
32+
Returns all artifacts with the tag "pssession"
33+
#>
234
[CmdletBinding()]
335
param (
436
[string]

PSModuleDevelopment/functions/build/Get-PSMDBuildProject.ps1

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
11
function Get-PSMDBuildProject {
2+
<#
3+
.SYNOPSIS
4+
Reads & returns a build project.
5+
6+
.DESCRIPTION
7+
Reads & returns a build project.
8+
A build project is a container including the steps executed during the build.
9+
10+
.PARAMETER Path
11+
Path to the build project file.
12+
May target the folder, in which case the -Name parameter must be specified.
13+
14+
.PARAMETER Name
15+
The name of the build project to read.
16+
Use together with the -Path parameter only.
17+
Absolute file path assumed will be: "<Path>\<Name>.build.json"
18+
19+
.PARAMETER Selected
20+
Rather than specifying the path to read from, return the currently selected build project.
21+
Use Select-PSMDBuildProject to select a build project as the default ("selected") project.
22+
23+
.EXAMPLE
24+
PS C:\> Get-PSMDBuildProject -Path 'C:\code\project' -Name project
25+
26+
Will load the build project stored in the file "C:\code\project\project.build.json"
27+
#>
228
[CmdletBinding(DefaultParameterSetName = 'Path')]
329
param (
430
[Parameter(Mandatory = $true, ParameterSetName = 'Path')]

PSModuleDevelopment/functions/build/Get-PSMDBuildStep.ps1

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
11
function Get-PSMDBuildStep {
2+
<#
3+
.SYNOPSIS
4+
Read the steps that are part of the specified build project.
5+
6+
.DESCRIPTION
7+
Read the steps that are part of the specified build project.
8+
9+
.PARAMETER Name
10+
The name by which to filter the steps returned.
11+
Defaults to '*'
12+
13+
.PARAMETER BuildProject
14+
Path to the build project file to read from.
15+
Defaults to the currently selected project if available.
16+
Use Select-PSMDBuildProject to select a default project.
17+
18+
.EXAMPLE
19+
PS C:\> Get-PSMDBuildStep
20+
21+
Read all steps that are part of the default build project.
22+
23+
.EXAMPLE
24+
PS C:\> Get-PSMDBuildStep -Name CreateSession -BuildProject C:\code\Project\Project.build.json
25+
26+
Return the CreateSession step from the specified project file.
27+
#>
228
[CmdletBinding()]
329
param (
430
[string]
Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,40 @@
11
function Select-PSMDBuildProject
22
{
3-
[CmdletBinding()]
4-
Param (
3+
<#
4+
.SYNOPSIS
5+
Set the specified build project as the default project.
56
6-
)
7+
.DESCRIPTION
8+
Set the specified build project as the default project.
9+
This will have most other commands in this Component automatically use the specified project.
710
8-
begin
9-
{
11+
.PARAMETER Path
12+
Path to the project file to pick.
13+
14+
.PARAMETER Register
15+
Persist the choice as default build project file across PowerShell sessions.
16+
17+
.EXAMPLE
18+
PS C:\> Select-PSMDBuildProject -Path 'c:\code\Project\Project.build.json'
19+
20+
Sets the specified build project as the default project.
21+
#>
22+
[CmdletBinding()]
23+
param (
24+
[Parameter(Mandatory = $true)]
25+
[string]
26+
$Path,
1027

11-
}
12-
process
13-
{
28+
[switch]
29+
$Register
30+
)
1431

15-
}
16-
end
32+
process
1733
{
18-
34+
Invoke-PSFProtectedCommand -ActionString 'Select-PSMDBuildProject.Testing' -ActionStringValues $Path -ScriptBlock {
35+
$null = Get-PSMDBuildProject -Path $Path -ErrorAction Stop
36+
} -Target $Path -EnableException $true -PSCmdlet $PSCmdlet
37+
Set-PSFConfig -Module PSModuleDevelopment -Name 'Build.Project.Selected' -Value $Path
38+
if ($Register) { Register-PSFConfig -Module PSModuleDevelopment -Name 'Build.Project.Selected' }
1939
}
2040
}

0 commit comments

Comments
 (0)