Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# psake Documentation

Terminology used to explain psake build definitions and reusable task distribution.

## Language

**Shared task module**:
A PowerShell module that distributes reusable psake task definitions through a module-root `psakeFile.ps1`.
_Avoid_: Shared module, build module, task library

**Provider module**:
The shared task module that owns and distributes reusable task definitions.
_Avoid_: Source module, plugin

**Consumer build**:
A psake build that references tasks from a provider module using `Task -FromModule`.
_Avoid_: Client build, importing build

**Shared task reference**:
A declaration in a consumer build that selects a provider task using `Task -FromModule`; it references a provider definition rather than defining a local task action.
_Avoid_: Imported task, module task import

**Public task**:
A provider task intended for consumers to reference directly. Public status is an authoring convention because psake registers every task in the provider task file without visibility boundaries.
_Avoid_: Exported task

**Supporting task**:
A provider task that exists primarily as a dependency of a public task. It remains directly invocable because psake does not enforce task visibility.
_Avoid_: Private task, internal task
1 change: 1 addition & 0 deletions docs/best-practices/organizing-large-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ Use the `compile.ps1`, `test.ps1`, and `deploy.ps1` implementations from the mod
## See Also

- [Access Functions in Another File](/docs/tutorial-advanced/access-functions-in-another-file) - Using Include and dot-sourcing
- [Creating Shared Task Modules](/docs/tutorial-advanced/creating-shared-task-modules) - Distributing versioned tasks across repositories
- [Structure of a psake Build Script](/docs/tutorial-advanced/structure-of-a-psake-build-script) - Basic script structure
- [Environment Management](/docs/best-practices/environment-management) - Managing multiple environments
- [Testing Build Scripts](/docs/best-practices/testing-build-scripts) - Testing your psake scripts
Expand Down
11 changes: 7 additions & 4 deletions docs/powershellbuild/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ This guide walks through adding PowerShellBuild to a PowerShell module project f
## Prerequisites

- PowerShell 5.1 or PowerShell 7+
- psake >= 4.9.0
- PowerShellBuild >= 0.7.0
- psake >= 5.0.4
- PowerShellBuild >= 0.8.2

These versions match PowerShellBuild 0.8.2. Check the [current module manifest](https://github.com/psake/PowerShellBuild/blob/main/PowerShellBuild/PowerShellBuild.psd1) when selecting a newer release.

Install both modules from the PowerShell Gallery:

Expand Down Expand Up @@ -56,10 +58,10 @@ properties {

task default -depends Build

task Build -FromModule PowerShellBuild -Version '0.7.1'
task Build -FromModule PowerShellBuild -RequiredVersion '0.8.2'
```

That is all you need. When psake runs the `Build` task, it loads it from the PowerShellBuild module and automatically runs the full dependency chain:
That is all you need. psake finds PowerShellBuild, dot-sources its module-root `psakeFile.ps1`, and registers the provider tasks in the current build context. Running `Build` then executes its reachable dependency chain:

```
Init → Clean → StageFiles → GenerateMarkdown → GenerateMAML → BuildHelp → Build
Expand Down Expand Up @@ -152,5 +154,6 @@ Invoke-Build Test
## Next Steps

- [Task Reference](./task-reference) — Full list of tasks and their dependencies
- [Creating Shared Task Modules](../tutorial-advanced/creating-shared-task-modules.md) — Build your own reusable task provider
- [Configuration](./configuration) — Customize `$PSBPreference` to fit your project
- [Real-World Example](./real-world-example) — A complete project with CI/CD integration
13 changes: 7 additions & 6 deletions docs/powershellbuild/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ PowerShellBuild lives under the same GitHub organization as psake (`psake/PowerS
┌─────────────────────────────────────┐
│ Your project's psakeFile.ps1 │
│ │
│ task Build -FromModule │
│ PowerShellBuild -Version 0.7.1 │
│ Task Build -FromModule │
│ PowerShellBuild │
│ -RequiredVersion 0.8.2 │
└────────────────┬────────────────────┘
│ psake loads tasks from
│ psake discovers task definitions
┌─────────────────────────────────────┐
│ PowerShellBuild module │
│ (Init → Clean → StageFiles → │
│ BuildHelp → Build → ...) │
└─────────────────────────────────────┘
```

When psake encounters a task declared with `-FromModule`, it automatically loads that task (and all its dependencies) from the installed module and runs them as if they were defined locally. Your `psakeFile.ps1` stays minimal; PowerShellBuild handles the details.
When psake encounters a task declared with `-FromModule`, it finds the selected module and dot-sources the module-root `psakeFile.ps1` in the current build context. That file registers all its provider tasks; psake later runs only `Build` and its reachable dependencies. This process does not itself import the module's `.psm1`.

## Also Supports Invoke-Build

Expand All @@ -66,7 +66,7 @@ Install PowerShellBuild from the PowerShell Gallery:
Install-Module -Name PowerShellBuild -Repository PSGallery
```

psake v4.9.0 or later is also required:
PowerShellBuild 0.8.2 requires psake 5.0.4 or later. Check the [current module manifest](https://github.com/psake/PowerShellBuild/blob/main/PowerShellBuild/PowerShellBuild.psd1) when selecting a newer version:

```powershell
Install-Module -Name psake -Repository PSGallery
Expand All @@ -84,6 +84,7 @@ Or declare both as dependencies in a `requirements.psd1` (managed via [PSDepend]
## See Also

- [Getting Started with PowerShellBuild](./getting-started) — Set up your first project
- [Creating Shared Task Modules](../tutorial-advanced/creating-shared-task-modules.md) — Build your own reusable task provider
- [Task Reference](./task-reference) — All available tasks and their dependencies
- [Configuration Reference](./configuration) — `$PSBPreference` settings
- [Real-World Example](./real-world-example) — Complete project walkthrough
Expand Down
2 changes: 2 additions & 0 deletions docs/tutorial-advanced/access-functions-in-another-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ Task Clean {

You can have more than 1 include file in your script if you need to include
multiple script files.

`Include` shares code within one repository. To distribute versioned tasks across repositories, see [Creating Shared Task Modules](./creating-shared-task-modules.md).
Loading