This tutorial takes you from a freshly created repository to a green CI run with your own module name. It assumes PowerShell 7+ is installed. Allow about 15 minutes.
On GitHub, open NWarila/powershell-template, click Use this template, and
create a new repository. Clone it locally:
git clone https://github.com/<you>/<your-repo>
cd <your-repo>The template ships a module called SampleModule. Rename it to yours
(Acme.Tools in this example):
git mv src/SampleModule src/Acme.Tools
git mv src/Acme.Tools/SampleModule.psm1 src/Acme.Tools/Acme.Tools.psm1
git mv src/Acme.Tools/SampleModule.psd1 src/Acme.Tools/Acme.Tools.psd1
git mv tests/SampleModule.Tests.ps1 tests/Acme.Tools.Tests.ps1Then update the references:
- In
src/Acme.Tools/Acme.Tools.psd1, setRootModule = 'Acme.Tools.psm1', a freshGUID(runpwsh -c "[guid]::NewGuid()"), yourAuthor,Description, and theProjectUri/LicenseUrito your repo. - In
tests/Acme.Tools.Tests.ps1, set$script:ModuleName = 'Acme.Tools'.
pwsh -c "Invoke-ScriptAnalyzer -Path . -Settings ./PSScriptAnalyzerSettings.psd1 -Recurse"
pwsh -File tests/Invoke-Tests.ps1Both should pass. The Pester run prints a coverage summary and writes NUnit and
JaCoCo reports under TestResults/.
Drop a new file under src/Acme.Tools/Public/ (one function per file). The root
module dot-sources it automatically. Add the function name to
FunctionsToExport in the manifest, then add a matching test under tests/.
git checkout -b feat/first-function
git add -A
git commit -m "feat: add first function"
git push -u origin feat/first-functionOpen a pull request. The CI workflow runs actionlint, PSScriptAnalyzer, and Pester. When all three are green, merge.