Skip to content

Commit 2fe2203

Browse files
committed
Move psake-config doc to Advanced Techniques and clarify scope
- Moved from tutorial-basics to tutorial-advanced since this is an uncommon, advanced topic - Added note that most projects don't need a config file - Added "Partial Overrides" section explaining that missing properties keep their defaults - Fixed cross-reference links https://claude.ai/code/session_0184Z4DLZ8Db72rkpca4kQwP
1 parent a5cd444 commit 2fe2203

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

docs/tutorial-advanced/custom-logging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Custom Logging
22

3-
psake routes all internal messages through configurable output handlers. You can override these handlers in your [`psake-config.ps1`](../tutorial-basics/psake-config.md) file to integrate with your own logging system.
3+
psake routes all internal messages through configurable output handlers. You can override these handlers in your [`psake-config.ps1`](./psake-config.md) file to integrate with your own logging system.
44

55
## Default Handlers
66

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
psake loads a `psake-config.ps1` file at the start of every build to set default values for your build environment. You can use this file to change psake's default build file name, framework version, task name format, output handlers, and more.
44

5+
:::note
6+
Most projects do not need a `psake-config.ps1` file. psake's built-in defaults work well for the majority of use cases. Only create one if you need to change a specific default.
7+
:::
8+
59
## How psake Finds the Config File
610

711
psake searches for `psake-config.ps1` in two locations, in order:
@@ -13,6 +17,10 @@ The first file found wins. If neither location contains a config file, psake use
1317

1418
This means you can place a `psake-config.ps1` next to your `psakefile.ps1` to customize settings per-project, or place one alongside the psake module for machine-wide defaults.
1519

20+
## Partial Overrides
21+
22+
Your config file does not need to set every property. psake initializes all properties to their defaults before loading your config file, so any property you omit keeps its default value. You only need to set the properties you want to change.
23+
1624
## Configuration Properties
1725

1826
Inside `psake-config.ps1`, you set properties on the `$config` variable. Here is every available property:
@@ -72,10 +80,10 @@ $config.modules = @(".\modules\*.psm1", ".\my_module.psm1")
7280

7381
## Output Handlers
7482

75-
psake routes all internal messages through configurable output handlers. For a full guide on customizing logging, see [Custom Logging](../tutorial-advanced/custom-logging.md).
83+
psake routes all internal messages through configurable output handlers. For a full guide on customizing logging, see [Custom Logging](./custom-logging.md).
7684

7785
## See Also
7886

79-
- [Custom Logging](../tutorial-advanced/custom-logging.md) — Override psake's output handlers
80-
- [Configuration Reference](../reference/configuration-reference.md) — Full reference for `Invoke-psake` parameters and build script settings
81-
- [Structure of a psake Build Script](../tutorial-advanced/structure-of-a-psake-build-script.md) — How build scripts are organized
87+
- [Custom Logging](./custom-logging.md) — Override psake's output handlers
88+
- [Configuration Reference](../reference/configuration-reference) — Full reference for `Invoke-psake` parameters and build script settings
89+
- [Structure of a psake Build Script](./structure-of-a-psake-build-script.md) — How build scripts are organized

sidebars.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const sidebars: SidebarsConfig = {
2020
'tutorial-basics/run-psake',
2121
'tutorial-basics/tasks',
2222
'tutorial-basics/parameters-properties',
23-
'tutorial-basics/psake-config',
2423
],
2524

2625
// Guides - How-to guides, examples, and best practices
@@ -43,6 +42,7 @@ const sidebars: SidebarsConfig = {
4342
'tutorial-advanced/build-script-resilience',
4443
'tutorial-advanced/debug-script',
4544
'tutorial-advanced/custom-logging',
45+
'tutorial-advanced/psake-config',
4646
'tutorial-advanced/logging-errors',
4747
'tutorial-advanced/outputs-and-artifacts',
4848
'tutorial-advanced/print-psake-task-name',

0 commit comments

Comments
 (0)