Welcome! This guide will help you set up your development environment and start building your PowerShell module.
- Visual Studio Code with PowerShell extension - Best development experience
- PSDepend - Dependency management
- GitHub Copilot - AI-assisted coding
- Docker or Rancher Desktop - For devcontainer support
- PowerShell Gallery account - Required only if you plan to publish your module
Click the "Use this template" button on GitHub to create a new repository from this template.
-
Fill in repository details:
- Name: Your module name (e.g.,
MyAwesomeModule) - Description: Brief description of your module
- Visibility: Public or Private
- Name: Your module name (e.g.,
-
Wait for bootstrap (~20 seconds):
- The automated workflow renames all references from
PSScriptModuleto your module name - Updates the module manifest with your description
- Removes template-specific files
- The automated workflow renames all references from
-
Refresh the page to see your customized repository
git clone https://github.com/YourUsername/YourModuleName.git
cd YourModuleNameIf you have Docker/Rancher Desktop installed:
- Open the repository in VS Code
- When prompted, click "Reopen in Container"
- All dependencies are pre-installed ✅
# Install PSDepend if not already installed
Install-Module -Name PSDepend -Scope CurrentUser -Force
# Install all project dependencies
Invoke-PSDepend -Path ./requirements.psd1 -Install -Import -ForceThis installs:
| Module | Purpose |
|---|---|
| InvokeBuild | Build orchestration |
| ModuleBuilder | Module compilation |
| Pester | Testing framework |
| PSScriptAnalyzer | Static code analysis |
| InjectionHunter | Security vulnerability scanning |
| Microsoft.PowerShell.PlatyPS | Help documentation generation |
# Test that build system works
Invoke-Build
# Expected output:
# Build YourModuleName 0.1.0
# Tasks: Clean, Build
# Build succeeded. 2 tasks, 0 errors, 0 warningsUnderstanding the project layout:
YourModuleName/
├── 📄 PSScriptModule.build.ps1 # Build script with all tasks
├── 📄 requirements.psd1 # Dependency configuration
├── 📄 GitVersion.yml # Version management config
│
├── 📁 src/ # Your module source code
│ ├── 📄 YourModuleName.psd1 # Module manifest (metadata)
│ ├── 📁 Public/ # Exported functions
│ ├── 📁 Private/ # Internal functions
│ └── 📁 Classes/ # Class definitions
│
├── 📁 tests/ # Quality assurance
│ ├── 📁 PSScriptAnalyzer/ # Code analysis tests
│ └── 📁 InjectionHunter/ # Security tests
│
├── 📁 docs/ # Documentation
│ ├── 📄 getting-started.md # This file
│ ├── 📄 development.md # Development workflow
│ ├── 📄 ci-cd.md # CI/CD and publishing
│ └── 📁 help/ # Command help (auto-generated)
│
└── 📁 build/ # Build output (generated)
└── 📁 out/ # Compiled module
Quick tweaks to make the template yours. For everything beyond setup, use the Development guide.
- Update manifest metadata in
src/YourModuleName.psd1(Author, CompanyName, Description, ProjectUri, LicenseUri, tags). - Adjust badges and links in
README.md. - Review
LICENSEandCONTRIBUTING.mdto match your project.
# Build once to verify toolchain
Invoke-Build
# (Optional) run tests
Invoke-Build Test- 📖 Development workflow, function patterns, and tests: development.md
- 🔄 CI/CD and publishing: ci-cd.md
- 🤖 AI contributor guidance: AGENTS.md
Ready to build something awesome? Let's code! 🚀