Sampler

0.120.0-preview0007

Sample Module with Pipeline scripts and its Plaster template to create a module following some of the community accepted practices.

Minimum PowerShell version

5.0

This is a prerelease version of Sampler.
There is a newer prerelease version of this module available.
See the version list below for details.

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name Sampler -RequiredVersion 0.120.0-preview0007 -AllowPrerelease

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name Sampler -Version 0.120.0-preview0007 -Prerelease

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) Gael Colas. All rights reserved.

Package Details

Author(s)

  • Gael Colas

Tags

Template pipeline plaster DesiredStateConfiguration DSC DSCResourceKit DSCResource Windows MacOS Linux

Functions

Add-Sample Convert-SamplerHashtableToString Get-BuiltModuleVersion Get-ClassBasedResourceName Get-CodeCoverageThreshold Get-MofSchemaName Get-OperatingSystemShortName Get-PesterOutputFileFileName Get-Psm1SchemaName Get-SamplerAbsolutePath Get-SamplerBuildVersion Get-SamplerBuiltModuleBase Get-SamplerBuiltModuleManifest Get-SamplerCodeCoverageOutputFile Get-SamplerCodeCoverageOutputFileEncoding Get-SamplerModuleInfo Get-SamplerModuleRootPath Get-SamplerProjectBuildInfo Get-SamplerProjectName Get-SamplerSourcePath Get-SamplerWorkspaceBuiltModulePath Get-SamplerWorkspaceLinkedModuleRoot Invoke-SamplerGit Merge-JaCoCoReport New-SampleModule New-SamplerJaCoCoDocument New-SamplerPipeline New-SamplerWorkspaceModuleLink Out-SamplerXml Set-SamplerPSModulePath Split-ModuleVersion Update-JaCoCoStatistic

Dependencies

Release Notes

## [0.120.0-preview0007] - 2026-07-03

### Added

- New `Copilot` Plaster template under `Sampler/Templates/Copilot/` that scaffolds GitHub Copilot instruction files and a `validate-changes` skill into any Sampler-based module. Available via `Add-Sample -Sample Copilot` and as a `copilot` feature option in `New-SampleModule` (CustomModule and CompleteSample).
- New `TypeAccelerators` Plaster template under `Sampler/Templates/TypeAccelerators/` that scaffolds a `suffix.ps1` exporting classes as type accelerators, the workaround pattern for PowerShell modules being unable to export classes directly. Available via `Add-Sample -Sample TypeAccelerators -SourceDirectory <path> -ExportableTypeName <ClassName>`. The generated file exposes two author-controlled lists (`$TypesToExportAsIs` for bare-name exports, `$TypesToExportWithNamespace` for `<ModuleName>.<ClassName>` exports) so each class's export name is a deliberate per-class choice. If an accelerator with the same name is already registered (for example after a `-Force` re-import during development), it is brute-force overridden (removed and re-registered) with a `Write-Verbose` message, rather than throwing.
- `TypeAccelerators` is now also available as a `Features` option in `New-SampleModule` (`CustomModule`, requires `Classes` and `SampleScripts`, or `All`) and is included unconditionally in the `CompleteSample` module type, scaffolding a `suffix.ps1` that exports the sample `Class1` as a type accelerator. `New-SampleModule`'s generated `build.yaml` also automatically uncomments `suffix: suffix.ps1` whenever this `suffix.ps1` file is scaffolded, so `ModuleBuilder` actually merges it in without extra manual steps.
- New `Type-Accelerators` wiki page (`Sampler/WikiSource/Type-Accelerators.md`, linked from `Home.md`) documenting the `TypeAccelerators` template, its design choices, and how to consume exported types from another module, referencing https://synedgy.com/powershell-modules-exporting-classes/ for background.
- New `Link_Local_Workspace_Dependencies` build task and supporting public functions (`Get-SamplerWorkspaceLinkedModuleRoot`, `Get-SamplerWorkspaceBuiltModulePath`, `New-SamplerWorkspaceModuleLink`) for linking sibling workspace module build outputs into the local module output path when working across related repos in a multi-repo workspace. Configure via `WorkspaceModules` in `build.yaml`.
- `Clean` task now preserves `output\agentic\` across builds (in addition to `RequiredModules`), providing a stable location for build and test log files that survive clean cycles. The subfolder name is configurable via the `AgentOutputSubdirectory` parameter (default `'agentic'`; set to empty string to disable the exclusion).
- `package_psresource_nupkg` tasks that recursively packs dependencies, ignoring `ExternalDependencies` using `PSResourceGet` module.

### Fixed

- `Fail_Build_If_Pester_Tests_Failed` and the `DscResource.Test` build task now fail
 the build when a Pester 5 run reports failed blocks or failed containers (for
 example a discovery failure such as an empty `-ForEach`), not only when
 `FailedCount` is greater than zero. Such container/discovery failures leave
 `FailedCount` at `0`, so the previous gate let them pass as a green build. The gate
 now uses the Pester 5 `Result` property and falls back to `FailedCount` for
 Pester 4 result objects.
- `Create_Release_Git_Tag` and `Create_Changelog_Branch` tasks now read `MainGitBranch` from `BuildInfo.GitConfig.MainGitBranch` in `build.yaml` when not set as a task parameter or InvokeBuild property. The resolution order is: task parameter -> `build.yaml` `GitConfig.MainGitBranch` -> default `'main'`.
- `Create_Release_Git_Tag` and `Create_Changelog_Branch` tasks no longer call `git config user.name` or `git config user.email` when `GitConfigUserName` or `GitConfigUserEmail` are not set (empty/null), allowing the existing global or system git identity to be used without being overwritten with an empty value.
- The `Build` Plaster template (`build.yaml.template`) now scaffolds a `GitConfig:` section with `MainGitBranch` pre-populated from the Plaster parameter entered during scaffolding, and `UserName`/`UserEmail` as commented-out examples.
- `New-SampleModule` now accepts `-GitHubOwner` and `-GitHubOwnerDscCommunity` parameters so the GitHub owner can be specified non-interactively when scaffolding GitHub-enabled or `dsccommunity` modules.
- `New-SampleModule` now forwards empty-string parameter values (such as `ModuleDescription = ''`) to Plaster instead of silently dropping them, eliminating unexpected interactive prompts when all parameters are splatted.
- `New-SampleModule` documents the `CustomModule` `ModuleType` and the new `MainGitBranch` parameter.
- `New-SampleModule` `ModuleType` `ValidateSet` now includes `CustomModule`.
- `New-SampleModule` exposes a `MainGitBranch` parameter (defaults to `main`) for templates that configure a default Git branch.
- GitHub Copilot guidance for the project under `.github/`:
 - `copilot-instructions.md` documenting build/test/quality commands, the mandatory `./build.ps1` entry point, high-level architecture, key conventions (changelog discipline, `-ErrorAction 'Ignore'` preference, cross-platform/cross-version PS5.1+PS7 support), guidance for running long builds without hanging the agent shell (always tee output to a log file), and how to extract test failures from the Pester NUnit XML and HQRM CliXml result files.
 - Per-area `instructions/*.instructions.md` files for public functions, private functions, Plaster templates, build tasks, and Pester tests.
 - `agents/sampler-maintainer.md` agent definition and the `skills/validate-changes` skill that picks the smallest useful test scope and surfaces XML-based failure diagnostics.

### Changed

- `New-SampleModule` no longer splits `ModuleType` and `Features` into separate parameter sets, so both can be supplied in the same invocation.
- Pester task setup now still supports repository-only test runs without a prebuilt module, but fails fast when a PowerShell module test workflow is invoked before the module output has been built.
- Documented the separation between source kind and artifact context in build-task guidance, clarified module-versus-non-module version fallback rules, and expanded the README with pipeline-shape documentation for module, alternate-artifact, and standalone repository flows.
- Added `Get-SamplerProjectBuildInfo` and updated Pester build tasks to use its `BuildType`/`HasBuiltOutput` project model directly instead of Pester-specific setup/import/identity wrapper functions.
- Pinned `ModuleBuilder` to `3.1.8` in `RequiredModules.psd1` because newer versions break Sampler task alias registration during tests.
- Temporarily skip the `SimpleModule` integration tests that depend on building the sample module on Windows PowerShell 5.1 while `ModuleBuilder` 3.2 is broken there.
- Change azure-pipelines.yml to support runtime parameters for running only selected platforms. Refactored the jobs to matrix jobs so it is not hardcoded jobs

### Fixed

- Update URL for PowerShell gallery pre-release badge ([#553](https://github.com/gaelcolas/Sampler/issues/553)).
- Update azure-pipelines task PublishCodeCoverageResults to v2 ([#551](https://github.com/gaelcolas/Sampler/issues/551)).
- Updated comment-based help for Resolve-Dependency.ps1
- Moved large parts of the ReadMe to the Wiki to handle Include simple tutorials in the Wiki ([issue #487](https://github.com/gaelcolas/Sampler/issues/487))
- Expanded the `CustomModule` section in the wiki `Getting-started` page to document the `-Features` parameter, list every supported feature value and show non-interactive examples.
- `Sampler` Plaster template
 - Fixed `Features` choice values so `azurepipelines`, `vscode`, `github`, and `codecov` are valid multichoice values (previously the Azure Pipelines option was unusable).
 - Fixed prompt conditions for `UseGit`, `UseGitVersion`, `UseCodeCovIo`, `UseGitHub`, `UseAzurePipelines`, `UseVSCode`, `License`, and `LicenseType` which contained contradictory `Features.Count` checks that prevented prompts from ever firing.
 - Fixed `GitHubOwner` condition that used `-contains` against an integer (`Features.Count`).
 - Replaced `${PLASTER_PARAM_Features} -in @(...)` checks with explicit `-contains` checks so multichoice `Features` arrays are evaluated correctly.
 - Fixed the `azure-pipelines.yml` file condition that referenced the non-existent `Azure-Pipelines` feature value.
 - Aligned `New-SampleModule` `Features` `ValidateSet` casing with the template's choice values.
- Made `Add-Sample` and `New-SamplerPipeline` resolve Plaster's culture-aware manifest-path helper at runtime so they work with both Plaster v2.x (`Get-PlasterManifestPathForCulture`) and Plaster v1.x (`GetPlasterManifestPathForCulture`).
- `Set-SamplerTaskVariable` now infers module sources from the source manifest, uses an explicit Chocolatey artifact context instead of build-output probing, and falls back to version `0.0.1` for non-module repositories when no manifest or GitVersion data is available.

FileList

Version History

Version Downloads Last updated
0.120.0-prev... 153 7/3/2026
0.120.0-prev... (current version) 7 7/3/2026
0.120.0-prev... 28 7/3/2026
0.120.0-prev... 40 7/2/2026
0.120.0-prev... 16 7/2/2026
0.120.0-prev... 27 7/1/2026
0.120.0-prev... 18 6/30/2026
0.120.0-prev... 13 6/30/2026
0.119.2-prev... 220 6/16/2026
0.119.2-prev... 62 6/12/2026
0.119.2-prev... 1,027 5/15/2026
0.119.2-prev... 826 4/23/2026
0.119.2-prev... 1,539 3/31/2026
0.119.2-prev... 9 3/31/2026
0.119.2-prev... 10 3/31/2026
0.119.2-prev... 66 3/30/2026
0.119.1 67,784 1/30/2026
0.119.1-prev... 19 1/29/2026
0.119.0 10,315 1/8/2026
0.119.0-prev... 12 1/7/2026
0.119.0-prev... 1,729 9/6/2025
0.119.0-prev... 18 9/5/2025
0.119.0-prev... 46 9/2/2025
0.119.0-prev... 583 7/16/2025
0.119.0-prev... 48 7/15/2025
0.118.4-prev... 342 6/11/2025
0.118.4-prev... 145 5/20/2025
0.118.4-prev... 40 5/14/2025
0.118.3 100,251 4/29/2025
0.118.3-prev... 6 4/29/2025
0.118.3-prev... 428 2/28/2025
0.118.2 42,698 1/19/2025
0.118.2-prev... 7 1/18/2025
0.118.2-prev... 8 1/18/2025
0.118.2-prev... 1,436 8/26/2024
0.118.2-prev... 1,217 7/28/2024
0.118.2-prev... 216 7/24/2024
0.118.1 91,070 7/20/2024
0.118.1-prev... 10 7/18/2024
0.118.1-prev... 9 7/17/2024
0.118.0-prev... 3,700 4/17/2024
0.118.0-prev... 378 4/6/2024
0.118.0-prev... 1,190 2/9/2024
0.118.0-prev... 1,081 1/13/2024
0.118.0-prev... 298 1/7/2024
0.117.1-prev... 8 1/7/2024
0.117.1-prev... 508 12/24/2023
0.117.0 171,060 9/29/2023
0.117.0-prev... 197 9/24/2023
0.117.0-prev... 29 9/21/2023
0.117.0-prev... 1,635 7/1/2023
0.116.6-prev... 8 6/30/2023
0.116.5 84,222 4/19/2023
0.116.5-prev... 169 4/17/2023
0.116.4 3,247 4/6/2023
0.116.4-prev... 9 4/6/2023
0.116.3 1,609 4/1/2023
0.116.3-prev... 9 4/1/2023
0.116.3-prev... 641 3/7/2023
0.116.2 10,894 3/1/2023
0.116.2-prev... 11 3/1/2023
0.116.2-prev... 1,052 1/24/2023
0.116.1 11,963 1/9/2023
0.116.0 26,855 11/8/2022
0.116.0-prev... 17 11/8/2022
0.116.0-prev... 37 11/1/2022
0.116.0-prev... 12 11/1/2022
0.116.0-prev... 13 11/1/2022
0.116.0-prev... 13 11/1/2022
0.116.0-prev... 792 8/3/2022
0.116.0-prev... 14 8/1/2022
0.116.0-prev... 754 7/9/2022
0.115.0 4,720 6/9/2022
0.115.0-prev... 464 5/29/2022
0.115.0-prev... 13 5/28/2022
0.115.0-prev... 133 5/23/2022
0.115.0-prev... 55 5/21/2022
0.115.0-prev... 52 5/20/2022
0.114.1-prev... 24 5/20/2022
0.114.0 1,475 5/13/2022
0.113.0-prev... 13 5/13/2022
0.112.4-prev... 29 5/13/2022
0.112.4-prev... 23 5/13/2022
0.112.3 1,773 3/31/2022
0.112.3-prev... 13 3/31/2022
0.112.2 555 3/20/2022
0.112.2-prev... 14 3/20/2022
0.112.2-prev... 831 2/16/2022
0.112.2-prev... 274 1/26/2022
0.112.1 2,410 1/23/2022
0.112.1-prev... 13 1/23/2022
0.112.1-prev... 12 1/23/2022
0.112.1-prev... 12 1/23/2022
0.112.1-prev... 311 12/1/2021
0.112.1-prev... 147 11/15/2021
0.112.1-prev... 166 10/1/2021
0.112.0 4,295 9/23/2021
0.112.0-prev... 24 9/8/2021
0.112.0-prev... 12 9/8/2021
0.112.0-prev... 15 9/5/2021
0.112.0-prev... 51 8/18/2021
0.111.8 1,316 8/8/2021
0.111.8-prev... 17 8/7/2021
0.111.7 238 7/31/2021
0.111.7-prev... 60 7/30/2021
0.111.7-prev... 75 7/28/2021
0.111.6 685 7/3/2021
0.111.6-prev... 25 7/2/2021
0.111.6-prev... 15 7/1/2021
0.111.5 272 6/25/2021
0.111.5-prev... 13 6/25/2021
0.111.5-prev... 98 6/17/2021
0.111.4 496 6/3/2021
0.111.4-prev... 12 6/3/2021
0.111.3 540 5/21/2021
0.111.3-prev... 12 5/21/2021
0.111.2 33 5/21/2021
0.111.2-prev... 13 5/21/2021
0.111.1 380 5/15/2021
0.111.1-prev... 14 5/15/2021
0.111.1-prev... 13 5/15/2021
0.111.0 199 5/13/2021
0.111.0-prev... 15 5/13/2021
0.111.0-prev... 14 5/13/2021
0.111.0-prev... 14 5/13/2021
0.111.0-prev... 72 5/7/2021
0.111.0-prev... 15 5/6/2021
0.111.0-prev... 23 5/4/2021
0.111.0-prev... 69 4/20/2021
0.111.0-prev... 65 4/16/2021
0.110.2-prev... 31 4/14/2021
0.110.2-prev... 59 4/13/2021
0.110.1 1,005 4/8/2021
0.110.1-prev... 17 4/8/2021
0.110.0 23 4/8/2021
0.110.0-prev... 14 4/8/2021
0.110.0-prev... 15 4/7/2021
0.110.0-prev... 15 4/7/2021
0.110.0-prev... 15 4/7/2021
0.109.11-pre... 22 3/29/2021
0.109.10 670 3/24/2021
0.109.10-pre... 18 3/22/2021
0.109.9 261 3/20/2021
0.109.9-prev... 15 3/20/2021
0.109.8 28 3/20/2021
0.109.8-prev... 16 3/20/2021
0.109.7 21 3/20/2021
0.109.7-prev... 16 3/20/2021
0.109.6 229 3/18/2021
0.109.6-prev... 18 3/18/2021
0.109.6-prev... 23 3/16/2021
0.109.5 404 3/10/2021
0.109.5-prev... 20 3/10/2021
0.109.5-prev... 24 3/10/2021
0.109.5-prev... 43 3/8/2021
0.109.5-prev... 15 3/7/2021
0.109.4 486 3/6/2021
0.109.4-prev... 17 3/6/2021
0.109.3 881 2/16/2021
0.109.3-prev... 17 2/16/2021
0.109.2 865 1/13/2021
0.109.2-prev... 18 1/13/2021
0.109.2-prev... 18 1/13/2021
0.109.1 324 1/6/2021
0.109.1-prev... 17 1/4/2021
0.109.1-prev... 17 12/29/2020
0.109.0 1,121 11/24/2020
0.109.0-prev... 15 11/24/2020
0.109.0-prev... 23 11/19/2020
0.109.0-prev... 17 11/18/2020
0.109.0-prev... 17 10/13/2020
0.108.0 715 9/14/2020
0.108.0-prev... 14 9/13/2020
0.108.0-prev... 14 9/13/2020
0.107.4-prev... 14 9/12/2020
0.107.4-prev... 13 9/11/2020
0.107.3 215 9/10/2020
0.107.3-prev... 14 9/10/2020
0.107.2 210 9/8/2020
0.107.2-prev... 15 9/8/2020
0.107.1 179 9/8/2020
0.107.1-prev... 15 9/7/2020
0.107.0 172 9/7/2020
0.107.0-prev... 13 9/7/2020
0.107.0-prev... 14 9/7/2020
0.106.1 209 8/30/2020
0.106.1-prev... 14 8/30/2020
0.106.0 190 8/30/2020
0.106.0-prev... 14 8/29/2020
0.106.0-prev... 23 8/21/2020
0.106.0-prev... 36 8/19/2020
0.106.0-prev... 15 8/18/2020
0.106.0-prev... 16 8/8/2020
0.105.7-prev... 20 7/11/2020
0.105.6 1,901 6/1/2020
0.105.6-prev... 15 6/1/2020
0.105.5 280 5/29/2020
0.105.5-prev... 17 5/29/2020
0.105.5-prev... 15 5/29/2020
0.105.4 174 5/29/2020
0.105.4-prev... 15 5/29/2020
0.105.4-prev... 15 5/28/2020
0.105.3 862 5/9/2020
0.105.3-prev... 15 5/9/2020
0.105.2 659 5/1/2020
0.105.2-prev... 14 5/1/2020
0.105.2-prev... 14 5/1/2020
0.105.2-prev... 14 4/24/2020
0.105.2-prev... 15 4/24/2020
0.105.1 481 4/24/2020
0.105.1-prev... 14 4/24/2020
0.105.0 302 4/21/2020
0.105.0-prev... 14 4/21/2020
0.105.0-prev... 15 4/18/2020
0.104.0 4,549 4/18/2020
0.104.0-prev... 15 4/18/2020
0.104.0-prev... 15 4/17/2020
0.103.0 210 4/17/2020
0.103.0-prev... 14 4/17/2020
0.102.1 1,336 2/21/2020
0.102.1-prev... 18 2/18/2020
0.102.1-prev... 17 2/18/2020
0.102.0 275 2/14/2020
0.102.0-prev... 17 2/14/2020
0.102.0-prev... 17 2/12/2020
0.101.0 253 2/10/2020
0.101.0-prev... 16 2/10/2020
0.101.0-prev... 18 2/7/2020
0.101.0-prev... 18 2/7/2020
0.100.0 461 2/1/2020
0.100.0-prev... 17 2/1/2020
0.99.4 392 1/22/2020
0.99.4-previ... 18 1/22/2020
0.99.4-previ... 16 1/22/2020
0.99.4-previ... 15 1/22/2020
0.99.3 182 1/21/2020
0.99.3-previ... 15 1/21/2020
0.99.2 299 1/16/2020
0.99.2-previ... 16 1/16/2020
0.99.1 154 1/16/2020
0.99.1-previ... 16 1/16/2020
0.99.1-previ... 17 1/9/2020
0.99.1-previ... 17 1/7/2020
0.99.1-previ... 15 1/7/2020
0.99.0 686 1/1/2020
0.99.0-previ... 14 1/1/2020
0.99.0-previ... 16 1/1/2020
0.99.0-previ... 15 1/1/2020
0.99.0-previ... 19 12/28/2019
0.99.0-previ... 17 12/28/2019
0.99.0-previ... 15 12/26/2019
0.98.1 520 12/24/2019
0.98.1-previ... 16 12/24/2019
0.98.1-previ... 15 12/23/2019
0.98.0 192 12/22/2019
0.98.0-previ... 16 12/22/2019
0.98.0-previ... 16 12/21/2019
0.97.0 452 12/9/2019
0.97.0-previ... 16 12/9/2019
0.96.1-previ... 17 11/8/2019
0.96.1-previ... 16 11/5/2019
0.96.0 340 11/1/2019
0.96.0-previ... 16 11/1/2019
0.95.2-previ... 16 11/1/2019
0.95.1 191 11/1/2019
0.95.1-previ... 16 11/1/2019
0.95.1-previ... 15 11/1/2019
0.95.0 178 11/1/2019
0.95.0-previ... 16 11/1/2019
0.94.0 181 10/30/2019
0.94.0-previ... 20 10/30/2019
0.94.0-previ... 17 10/30/2019
0.93.3-previ... 17 10/30/2019
0.93.2 178 10/30/2019
0.93.2-previ... 15 10/30/2019
0.93.2-previ... 15 10/30/2019
0.93.2-previ... 14 10/29/2019
0.93.1 184 10/29/2019
0.93.1-previ... 16 10/29/2019
0.93.1-previ... 16 10/29/2019
0.93.0 176 10/29/2019
0.93.0-previ... 15 10/29/2019
0.93.0-previ... 15 10/29/2019
0.93.0-previ... 14 10/23/2019
0.93.0-previ... 15 10/23/2019
0.93.0-previ... 22 10/22/2019
0.93.0-previ... 18 10/20/2019
0.92.2-previ... 15 10/15/2019
0.92.1 203 10/15/2019
0.92.1-previ... 14 10/15/2019
0.92.0 176 10/15/2019
0.92.0-previ... 14 10/14/2019
0.92.0-previ... 16 10/14/2019
0.92.0-previ... 14 10/14/2019
0.92.0-previ... 15 10/14/2019
0.91.7-previ... 15 10/11/2019
0.91.6 181 10/11/2019
0.91.6-previ... 15 10/10/2019
0.91.6-previ... 14 10/10/2019
0.91.6-previ... 15 10/10/2019
0.89.7-previ... 15 10/10/2019
Show more