{"id":8912708,"url":"https://github.com/38ES/PSMake","last_synced_at":"2025-08-10T10:32:30.186Z","repository":{"id":235504870,"uuid":"758553802","full_name":"38ES/PSMake","owner":"38ES","description":"PSMake is an all-in-one project management and lifecycle toolset for PowerShell.","archived":false,"fork":false,"pushed_at":"2024-06-03T15:37:58.000Z","size":266,"stargazers_count":19,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-21T11:36:20.974Z","etag":null,"topics":["build","build-tool","dependency-manager","lifecycle","powershell","powershell-module","project-management","publishing","testing"],"latest_commit_sha":null,"homepage":"https://www.powershellgallery.com/packages/PSMake","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/38ES.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2024-02-16T15:13:15.000Z","updated_at":"2024-07-29T15:58:33.000Z","dependencies_parsed_at":"2024-04-29T05:30:07.889Z","dependency_job_id":null,"html_url":"https://github.com/38ES/PSMake","commit_stats":null,"previous_names":["38es/psmake"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/38ES%2FPSMake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/38ES%2FPSMake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/38ES%2FPSMake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/38ES%2FPSMake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/38ES","download_url":"https://codeload.github.com/38ES/PSMake/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229399723,"owners_count":18067082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["build","build-tool","dependency-manager","lifecycle","powershell","powershell-module","project-management","publishing","testing"],"created_at":"2024-05-01T21:05:34.705Z","updated_at":"2024-12-12T14:30:41.378Z","avatar_url":"https://github.com/38ES.png","language":"PowerShell","readme":"# PSMake\n## PowerShell Project Management and Lifecycle\n\u003cimg src=\"./meta/psmake-logo.png\" width=\"500\"\u003e\n\nPSMake is an all-in-one project management and lifecycle toolset for PowerShell.\n\n### ❗NOTICE ❗\nPlease see the [NOTICE](./NOTICE) regarding copyright and ownership information as it\n_highly_ affects the [LICENSE](./LICENSE).\n\n### Traditional PowerShell Module Development Problems\n1. Only a Manifest (psd1) and module file (psm1) with all logic in one file\n2. No seperation of development and production - *Unit Tests distributed to users?* 😬\n3. Separating the functions into individual ps1 files and dotsourcing them creates a nightmare for code signing\n4. Code signing breaks every time there is a change and PowerShell refuses to import the module.\n6. Getting around these issues is up to each project to create their own solutions making every project a unique with no known conventions - *You can't automate without standards and conventions*\n\n\n### Highlights\nCreates the standards and conventions lacking the traditional PowerShell development without being too rigid. Conventions and behaviors can be changed per project without breaking known usages of PSMake.\n1. Project is made of seperate function scripts (ps1 files) within the *functions* folder allowing for custom scoping - *no more implicit global scope*\n2. Unit test files are in a seperate *tests* folder that run on the development version of the module. *No more distributing the unit tests to users*\n3. Generates a distributable version of the module in a flexible, easy-to-read build manifest file (build.psd1)\n4. Capable of code signing output files for a given target (Debug, Release, Prerelease).\n5. Able to scaffold new projects without any changes necessary - *turn-key ready*.\n\n### Who should use this?\nAny PowerShell script project should use this whether simple or complex. Binary modules written in C# can also use it, but may not be necessary.\n\n### Examples\n#### Create a new project\n```pwsh\nPS\u003e PSMake template MyProjectName\n```\n\n#### Build release version of the module\n```pwsh\nPS\u003e PSMake # Default parameters are 'build Release'\n```\n```pwsh\nPS\u003e PSMake build Release\n```\n\n#### Build Debug version of the module\n```pwsh\nPS\u003e PSMake build Debug\n```\n\n#### Run unit tests on the module\n```pwsh\nPS\u003e PSMake test\n```\n\n#### Run unit tests, but pass a parameter for reports (code coverage and test result xml files)\n```pwsh\nPS\u003e PSMake test reports\n```\n\n#### Clean the project (removes the distribution (dist) folder containing the generated module)\n```pwsh\nPS\u003e PSMake clean\n```\n\n#### Publish the release version of the module\n```pwsh\nPS\u003e PSMake publish 'Your-NuGet-API-Key'\n```\n\n### Customizing the project workflow - build.psd1\nPSD1 files are a text document containing a PowerShell hashtable (```@{}```) with *keys* being set equal to a *value*.\n\nThe ```build.psd1``` file is a PowerShell hashtable with expected keys. Some keys are required while others are optional with an implicit default value. A ```build.psd1``` can be generated using the [Create a new Project](#create-a-new-project) example. The generated file contains all available keys and documentation on its behavior and expected type.\n\nThe workflow keys are ```Build```, ```Clean```, ```Test```, and ```Publish``` with each assigned to a scriptblock (```{}```) literal. This scriptblock is called in the scope of the PSMake module giving access to the special commands that express the build intent.\n\n#### Special Commands\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003eCommand\u003c/td\u003e\n\u003ctd\u003eDescription\u003c/td\u003e\n\u003ctd\u003eExample\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eAddType\u003c/td\u003e\n\u003ctd\u003eAdds a C# file using Add-Type to the psm1 file\u003c/td\u003e\n\u003ctd\u003e\n\n```pwsh\nAddType {\n    'classes/MyClass.cs'\n}\n```\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eCodeSign\u003c/td\u003e\n\u003ctd\u003eCode signs the returns files from the given scriptblock\u003c/td\u003e\n\u003ctd\u003e\n\n```pwsh\nCodeSign {\n    'file1'\n    'file2'\n}\n```\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eCollate\u003c/td\u003e\n\u003ctd\u003eBrings multiple function ps1 files into a single psm1 file\u003c/td\u003e\n\u003ctd\u003e\n\n```pwsh\nCollate {\n    './functions/file1.ps1'\n    './functions/file2.ps1'\n}\n```\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eCopyDirectory\u003c/td\u003e\n\u003ctd\u003eCopies directories into the distribution folder\u003c/td\u003e\n\u003ctd\u003e\n\n```pwsh\nCopyDirectory {\n    './functions'\n}\n```\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eCopyFiles\u003c/td\u003e\n\u003ctd\u003eCopies files into the distribution folder\u003c/td\u003e\n\u003ctd\u003e\n\n```pwsh\nCopyFiles {\n    'manifest.psd1'\n}\n```\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eCreateDirectory\u003c/td\u003e\n\u003ctd\u003eCreates a directory in the distribution folder\u003c/td\u003e\n\u003ctd\u003e\n\n```pwsh\nCreateDirectory {\n    'MyFolder'\n}\n```\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eCustomCode\u003c/td\u003e\n\u003ctd\u003eAdds codes to the generated psm1 file in the distribution folder\u003c/td\u003e\n\u003ctd\u003e\n\n```pwsh\nCustomCode {\n    # Add custom code here\n}\n```\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eDebug\u003c/td\u003e\n\u003ctd\u003eOnly runs the given scriptblock when the build target is Debug\u003c/td\u003e\n\u003ctd\u003e\n\n```pwsh\nDebug {\n    CopyFiles {\n        'module.psm1'\n    }\n}\n```\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eRelease\u003c/td\u003e\n\u003ctd\u003eOnly runs the given scriptblock when the build target is Release. Also provides a \u003ccode\u003e-AndPrerelease\u003c/code\u003e switch to run for release AND prerelease targets\u003c/td\u003e\n\u003ctd\u003e\n\n```pwsh\nRelease {\n    Collate {\n        Get-ChildItem ./functions/*.ps1\n    }\n} -AndPrerelease\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003ePrerelease\u003c/td\u003e\n\u003ctd\u003eOnly runs the given scripblock when the build target is Prerelease\u003c/td\u003e\n\u003ctd\u003e\n\n```pwsh\nPrerelease {\n    SetPrereleaseTag {\n        'MyModuleManifest.psd1'\n    }\n}\n```\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eSetPrereleaseTag\u003c/td\u003e\n\u003ctd\u003eSets the Prerelease property within a manifest file to mark the module as a prerelease within PSResourceGet or PowerShellGet\u003c/td\u003e\n\u003ctd\u003e\n\n```pwsh\nSetPrereleaseTag {\n    'MyModuleManifest.psd1'\n}\n```\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eUsingModule\u003c/td\u003e\n\u003ctd\u003eAdds a \u003ccode\u003eusing module\u003c/code\u003e command to the generated psm1 file\u003c/td\u003e\n\u003ctd\u003e\n\n```pwsh\nUsingModule {\n    'MySpecialModule'\n}\n```\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n### Contributing\nPSMake is open to community contributions! Please read the [CONTRIBUTING.md](./CONTRIBUTING.md) file for details on how to contribute!\n","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F38ES%2FPSMake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F38ES%2FPSMake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F38ES%2FPSMake/lists"}