{"id":18376425,"url":"https://github.com/psake/powershellbuild","last_synced_at":"2026-02-21T02:08:10.557Z","repository":{"id":30333517,"uuid":"124632966","full_name":"psake/PowerShellBuild","owner":"psake","description":"Common build tasks for psake and Invoke-Build that build and test PowerShell modules","archived":false,"fork":false,"pushed_at":"2026-02-19T06:23:52.000Z","size":1422,"stargazers_count":143,"open_issues_count":6,"forks_count":25,"subscribers_count":19,"default_branch":"main","last_synced_at":"2026-02-19T07:06:42.837Z","etag":null,"topics":["invoke-build","powershell","psake"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/psake.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"psake","open_collective":"psake"}},"created_at":"2018-03-10T07:28:11.000Z","updated_at":"2026-02-19T01:04:13.000Z","dependencies_parsed_at":"2024-11-06T00:26:43.994Z","dependency_job_id":"c36beb48-c272-4d6b-92ec-8f9a10ac1978","html_url":"https://github.com/psake/PowerShellBuild","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/psake/PowerShellBuild","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psake%2FPowerShellBuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psake%2FPowerShellBuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psake%2FPowerShellBuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psake%2FPowerShellBuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/psake","download_url":"https://codeload.github.com/psake/PowerShellBuild/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psake%2FPowerShellBuild/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29671513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T00:11:43.526Z","status":"online","status_checked_at":"2026-02-21T02:00:07.432Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["invoke-build","powershell","psake"],"created_at":"2024-11-06T00:23:17.719Z","updated_at":"2026-02-21T02:08:10.551Z","avatar_url":"https://github.com/psake.png","language":"PowerShell","funding_links":["https://github.com/sponsors/psake","https://opencollective.com/psake"],"categories":[],"sub_categories":[],"readme":"# PowerShellBuild\n\n| GitHub Actions                                                                                                                                        | PS Gallery                                          | License                              |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|--------------------------------------|\n| [![GitHub Actions Status][github-actions-badge]][github-actions-build] [![GitHub Actions Status][github-actions-badge-publish]][github-actions-build] | [![PowerShell Gallery][psgallery-badge]][psgallery] | [![License][license-badge]][license] |\n\nThis project aims to provide common [psake](https://github.com/psake/psake) and\n[Invoke-Build](https://github.com/nightroman/Invoke-Build) tasks for building,\ntesting, and publishing PowerShell modules.\n\nUsing these shared tasks reduces the boilerplate scaffolding needed in most\nPowerShell module projects and help enforce a consistent module structure. This\nconsistency ultimately helps the community in building high-quality PowerShell\nmodules.\n\n\u003e If using [psake](https://github.com/psake/psake) as your task runner, version\n\u003e `4.8.0` or greater is required to make use of shared tasks distributed in\n\u003e separate modules. To install psake `4.8.0` you can run:\n\n```powershell\nInstall-Module -Name psake -RequiredVersion 4.8.0 -Repository PSGallery\n```\n\n\u003e For [Invoke-Build](https://github.com/nightroman/Invoke-Build), see the\n\u003e [how to dot source tasks using PowerShell aliases](https://github.com/nightroman/Invoke-Build/blob/master/Tasks/Import/README.md#example-2-import-from-a-module-with-tasks)\n\u003e example.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"media/psaketaskmodule-256x256.png\" alt=\"Logo\"\u003e\n\u003c/p\u003e\n\n## Status - Work in progress\n\n\u003e This project is a **work in progress** and may change significantly before\n\u003e reaching stability based on feedback from the community. **Please do not base\n\u003e critical processes on this project** until it has been further refined.\n\n## Tasks\n\n**PowerShellBuild** is a PowerShell module that provides helper functions to\nhandle the common build, test, and release steps typically found in PowerShell\nmodule projects. These steps are exposed as a set of\n[psake](https://github.com/psake/psake) tasks found in\n[psakeFile.ps1](./PowerShellBuild/psakeFile.ps1) in the root of the module, and\nas PowerShell aliases which you can dot source if using\n[Invoke-Build](https://github.com/nightroman/Invoke-Build). In psake `v4.8.0`, a\nfeature was added to reference shared psake tasks distributed within PowerShell\nmodules. This allows a set of tasks to be versioned, distributed, and called by\nother projects.\n\n### Primary Tasks\n\nThese primary tasks are the main tasks you'll typically call as part of\nPowerShell module development.\n\n| Name    | Dependencies          | Description                                     |\n|---------|-----------------------|-------------------------------------------------|\n| Init    | _none_                | Initialize psake and task variables             |\n| Clean   | init                  | Clean output directory                          |\n| Build   | StageFiles, BuildHelp | Clean and build module in output directory      |\n| Analyze | Build                 | Run PSScriptAnalyzer tests                      |\n| Pester  | Build                 | Run Pester tests                                |\n| Test    | Analyze, Pester       | Run combined tests                              |\n| Publish | Test                  | Publish module to defined PowerShell repository |\n\n### Secondary Tasks\n\nThese secondary tasks are called as dependencies from the primary tasks but may\nalso be called directly.\n\n| Name                  | Dependencies                   | Description                      |\n|-----------------------|--------------------------------|----------------------------------|\n| BuildHelp             | GenerateMarkdown, GenerateMAML | Build all help files             |\n| StageFiles            | Clean                          | Build module in output directory |\n| GenerateMarkdown      | StageFiles                     | Build markdown-based help        |\n| GenerateMAML          | GenerateMarkdown               | Build MAML help                  |\n| GenerateUpdatableHelp | BuildHelp                      | Build updatable help cab         |\n\n## Task customization\n\nThe psake and Invoke-Build tasks can be customized by overriding the values\ncontained in the `$PSBPreference` hashtable. defined in the psake file. These\nsettings govern if certain tasks are executed or set default paths used to build\nand test the module. You can override these in either psake or Invoke-Build to\nmatch your environment.\n\n| Setting                                                     | Default value                               | Description                                                                                                                                                                  |\n|-------------------------------------------------------------|---------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| $PSBPreference.General.ProjectRoot                          | `$env:BHProjectPath`                        | Root directory for the project                                                                                                                                               |\n| $PSBPreference.General.SrcRootDir                           | `$env:BHPSModulePath`                       | Root directory for the module                                                                                                                                                |\n| $PSBPreference.General.ModuleName                           | `$env:BHProjectName`                        | The name of the module. This should match the basename of the PSD1 file                                                                                                      |\n| $PSBPreference.General.ModuleVersion                        | `\\\u003ccomputed\u003e`                               | The version of the module                                                                                                                                                    |\n| $PSBPreference.General.ModuleManifestPath                   | `$env:BHPSModuleManifest`                   | Path to the module manifest (PSD1)                                                                                                                                           |\n| $PSBPreference.Build.OutDir                                 | `$projectRoot/Output`                       | Output directory when building the module                                                                                                                                    |\n| $PSBPreference.Build.Dependencies                           | 'StageFiles, 'BuildHelp'                    | Default task dependencies for the `Build` task                                                                                                                               |\n| $PSBPreference.Build.ModuleOutDir                           | `$outDir/$moduleName/$moduleVersion`        | `For internal use only. Do not overwrite. Use '$PSBPreference.Build.OutDir' to set output directory`                                                                         |\n| $PSBPreference.Build.CompileModule                          | `$false`                                    | Controls whether to \"compile\" module into single PSM1 or not                                                                                                                 |\n| $PSBPreference.Build.CompileDirectories                     | `@('Enum', 'Classes', 'Private', 'Public')` | List of directories to \"compile\" into monolithic PSM1. Only valid when `$PSBPreference.Build.CompileModule` is `$true`.                                                      |\n| $PSBPreference.Build.CopyDirectories                        | `@()`                                       | List of directories to copy \"as-is\" to built module                                                                                                                          |\n| $PSBPreference.Build.CompileHeader                          | `\u003cempty\u003e`                                   | String that appears at the top of your compiled PSM1 file                                                                                                                    |\n| $PSBPreference.Build.CompileFooter                          | `\u003cempty\u003e`                                   | String that appears at the bottom of your compiled PSM1 file                                                                                                                 |\n| $PSBPreference.Build.CompileScriptHeader                    | `\u003cempty\u003e`                                   | String that appears in your compiled PSM1 file before each added script                                                                                                      |\n| $PSBPreference.Build.CompileScriptFooter                    | `\u003cempty\u003e`                                   | String that appears in your compiled PSM1 file after each added script                                                                                                       |\n| $PSBPreference.Build.Exclude                                | `\u003cempty\u003e`                                   | Array of files (regular expressions) to exclude when building module                                                                                                         |\n| $PSBPreference.Test.Enabled                                 | `$true`                                     | Enable/disable Pester tests                                                                                                                                                  |\n| $PSBPreference.Test.RootDir                                 | `$projectRoot/tests`                        | Directory containing Pester tests                                                                                                                                            |\n| $PSBPreference.Test.OutputFile                              | `$null`                                     | Output file path Pester will save test results to                                                                                                                            |\n| $PSBPreference.Test.OutputFormat                            | `NUnitXml`                                  | Test output format to use when saving Pester test results                                                                                                                    |\n| $PSBPreference.Test.ScriptAnalysis.Enabled                  | `$true`                                     | Enable/disable use of PSScriptAnalyzer to perform script analysis                                                                                                            |\n| $PSBPreference.Test.ScriptAnalysis.FailBuildOnSeverityLevel | `Error`                                     | PSScriptAnalyzer threshold to fail the build on                                                                                                                              |\n| $PSBPreference.Test.ScriptAnalysis.SettingsPath             | `./ScriptAnalyzerSettings.psd1`             | Path to the PSScriptAnalyzer settings file                                                                                                                                   |\n| $PSBPreference.Test.CodeCoverage.Enabled                    | `$false`                                    | Enable/disable Pester code coverage reporting                                                                                                                                |\n| $PSBPreference.Test.CodeCoverage.Threshold                  | `.75`                                       | Fail Pester code coverage test if below this threshold                                                                                                                       |\n| $PSBPreference.Test.CodeCoverage.Files                      | `*.ps1, *.psm1`                             | Files to perform code coverage analysis on                                                                                                                                   |\n| $PSBPreference.Test.CodeCoverage.OutputFile                 | `coverage.xml`                              | Output file path (relative to Pester test directory) where Pester will save code coverage results to                                                                         |\n| $PSBPreference.Test.CodeCoverage.OutputFileFormat           | `$null`                                     | Test output format to use when saving Pester code coverage results                                                                                                           |\n| $PSBPreference.Test.ImportModule                            | `$false`                                    | Import module from output directory prior to running Pester tests                                                                                                            |\n| $PSBPreference.Test.SkipRemainingOnFailure                  | `None`                                      | Skip remaining tests after failure for selected scope. Options are None, Run, Container and Block.                                                                           |\n| $PSBPreference.Test.OutputVerbosity                         | `Detailed`                                  | Set verbosity of output. Options are None, Normal, Detailed and Diagnostic.                                                                                                  |\n| $PSBPreference.Help.UpdatableHelpOutDir                     | `$OutDir/UpdatableHelp`                     | Output directory to store update module help (CAB)                                                                                                                           |\n| $PSBPreference.Help.DefaultLocale                           | `(Get-UICulture).Name`                      | Default locale used for help generation                                                                                                                                      |\n| $PSBPreference.Help.ConvertReadMeToAboutHelp                | `$false`                                    | Convert project readme into the module about file                                                                                                                            |\n| $PSBPreference.Docs.RootDir                                 | `$projectRoot/docs`                         | Directory PlatyPS markdown documentation will be saved to                                                                                                                    |\n| $PSBPreference.Docs.Overwrite                               | `$false`                                    | Overwrite the markdown files in the docs folder using the comment based help as the source of truth.                                                                         |\n| $PSBPreference.Docs.AlphabeticParamsOrder                   | `$false`                                    | Order parameters alphabetically by name in PARAMETERS section. There are 5 exceptions: -Confirm, -WhatIf, -IncludeTotalCount, -Skip, and -First parameters will be the last. |\n| $PSBPreference.Docs.ExcludeDontShow                         | `$false`                                    | Exclude the parameters marked with `DontShow` in the parameter attribute from the help content.                                                                              |\n| $PSBPreference.Docs.UseFullTypeName                         | `$false`                                    | Indicates that the target document will use a full type name instead of a short name for parameters.                                                                         |\n| $PSBPreference.Publish.PSRepository                         | `PSGallery`                                 | PowerShell repository name to publish                                                                                                                                        |\n| $PSBPreference.Publish.PSRepositoryApiKey                   | `$env:PSGALLERY_API_KEY`                    | API key to authenticate to PowerShell repository with                                                                                                                        |\n| $PSBPreference.Publish.PSRepositoryCredential               | `$null`                                     | Credential to authenticate to PowerShell repository with. Overrides `$psRepositoryApiKey` if defined                                                                         |\n\n## Modifying Task Dependencies\n\nTo change which tasks depend on each other, set the variables below in your\n`psakeFile.ps1`. Unlike `$PSBPreference` settings, these variables should be set\noutside the `properties` block, before you reference any PowerShellBuild tasks.\n\n| Setting                             | Default value                      | Description                                        |\n|-------------------------------------|------------------------------------|----------------------------------------------------|\n| $PSBCleanDependency                 | 'Init'                             | Tasks the 'Clean' task depends on.                 |\n| $PSBStageFilesDependency            | 'Clean'                            | Tasks the 'StageFiles' task depends on.            |\n| $PSBBuildDependency                 | 'StageFiles', 'BuildHelp'          | Tasks the 'Build' task depends on.                 |\n| $PSBAnalyzeDependency               | 'Build'                            | Tasks the 'Analyze' task depends on.               |\n| $PSBPesterDependency                | 'Build'                            | Tasks the 'Pester' task depends on.                |\n| $PSBTestDependency                  | 'Pester', 'Analyze'                | Tasks the 'Test' task depends on.                  |\n| $PSBBuildHelpDependency             | 'GenerateMarkdown', 'GenerateMAML' | Tasks the 'BuildHelp' task depends on.             |\n| $PSBGenerateMarkdownDependency      | 'StageFiles'                       | Tasks the 'GenerateMarkdown' task depends on.      |\n| $PSBGenerateMAMLDependency          | 'GenerateMarkdown'                 | Tasks the 'GenerateMAML' task depends on.          |\n| $PSBGenerateUpdatableHelpDependency | 'BuildHelp'                        | Tasks the 'GenerateUpdatableHelp' task depends on. |\n| $PSBPublishDependency               | 'Test'                             | Tasks the 'Publish' task depends on.               |\n\n## Examples\n\n### psake\n\nThe example below is a psake file you might use in your PowerShell module. When\npsake executes this file, it will recognize that tasks are being referenced from\na separate module and automatically load them. You can run these tasks just as\nif they were included directly in your task file.\n\nNotice that the task file contained in `MyModule` only references the `Build`\ntask supplied from `PowerShellBuild`. When executed, the dependent tasks `Init`,\n`Clear`, and `StageFiles` also contained in `PowerShellBuild` are executed as\nwell.\n\n#### psakeBuild.ps1\n\n```powershell\nproperties {\n    # These settings overwrite values supplied from the PowerShellBuild\n    # module and govern how those tasks are executed\n    $PSBPreference.Test.ScriptAnalysisEnabled = $false\n    $PSBPreference.Test.CodeCoverage.Enabled  = $true\n}\n\ntask default -depends Build\n\ntask Build -FromModule PowerShellBuild -Version '0.1.0'\n```\n\n![Example](./media/psake_example.png)\n\n### Invoke-Build\n\nThe example below is an\n[Invoke-Build](https://github.com/nightroman/Invoke-Build) task file that\nimports the `PowerShellBuild` module which contains the shared tasks and then\ndot sources the Invoke-Build task files that are referenced by the PowerShell\nalias `PowerShellBuild.IB.Tasks`. Additionally, certain settings that control\nhow the build tasks operate are overwritten after the tasks have been imported.\n\n#### .build.ps1\n\n```powershell\nImport-Module PowerShellBuild\n. PowerShellBuild.IB.Tasks\n\n# Overwrite build settings contained in PowerShellBuild\n$PSBPreference.Test.ScriptAnalysisEnabled = $true\n$PSBPreference.Test.CodeCoverage.Enabled  = $false\n```\n\n![Example](./media/ib_example.png)\n\n[github-actions-badge]: https://github.com/psake/PowerShellBuild/actions/workflows/test.yml/badge.svg\n[github-actions-badge-publish]: https://github.com/psake/PowerShellBuild/actions/workflows/publish.yaml/badge.svg\n[github-actions-build]: https://github.com/psake/PowerShellBuild/actions\n[psgallery-badge]: https://img.shields.io/powershellgallery/dt/powershellbuild.svg\n[psgallery]: https://www.powershellgallery.com/packages/PowerShellBuild\n[license-badge]: https://img.shields.io/github/license/psake/PowerShellBuild.svg\n[license]: https://raw.githubusercontent.com/psake/PowerShellBuild/main/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsake%2Fpowershellbuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpsake%2Fpowershellbuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsake%2Fpowershellbuild/lists"}