Thank you for considering contributing to PowerShell DevKit! This guide will help you get started.
- Fork the repository on GitHub
- Clone your fork locally
- Create a feature branch
- Make your changes
- Validate with
Validate-Code.ps1 - Test with
Test.ps1 - Commit with descriptive messages
- Push to your fork
- Open a Pull Request
- Windows 10/11
- PowerShell 7+
- Git
- Code editor (VS Code recommended)
# Fork the repository on GitHub first
# Clone your fork
git clone https://github.com/YOUR-USERNAME/PowerShell-DevKit.git
cd PowerShell-DevKit
# Add upstream remote
git remote add upstream https://github.com/Tsabo/PowerShell-DevKit.git
# Install the environment
.\Scripts\Setup.ps1# REQUIRED: Run validation
.\Scripts\Validate-Code.ps1
# This checks:
# - PSScriptAnalyzer rules
# - Syntax errors
# - Code formatting
# - Best practicesMust pass before committing!
# Validate environment
.\Scripts\Test.ps1
# Test specific functionality
# - Install/update components
# - Configuration deployment
# - Error handlingIf your changes affect:
- User-facing features → Update docs/
- Scripts → Update relevant script documentation
- Components → Update component pages
- Architecture → Update architecture docs
Great for beginners!
Edit Scripts/Components.psm1:
@{
Name = "New Tool"
Type = "winget" # or "module" or "custom"
IsOptional = $false
Properties = @{
PackageId = "Publisher.NewTool"
}
}See Component System for details.
Add .psm1 files to PowerShell/IncludedModules/:
# Example: PowerShell/IncludedModules/my-tools.psm1
function Get-MyTool {
[CmdletBinding()]
param([string]$Name)
Write-Host "Tool: $Name"
}
Export-ModuleMember -Function Get-MyTool- Fix typos or clarify existing docs
- Add examples
- Create missing pages
- Update screenshots
- Search existing issues
- Create issue if not exists
- Reference issue in PR
- Discuss in issues first
- Get feedback on approach
- Implement with tests
- Document the feature
# Good: Clear function names
function Get-UserData {
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$UserId
)
# Implementation
}
# Good: Comment-based help
<#
.SYNOPSIS
Gets user data
.PARAMETER UserId
The user identifier
.EXAMPLE
Get-UserData -UserId "12345"
#>The project uses PSScriptAnalyzerSettings.psd1:
- No aliases in scripts
- Proper parameter names
- Error handling
- Comment-based help
# Good: Try/catch with logging
try {
$result = Invoke-Operation
}
catch {
Write-Error "Operation failed: $_"
Write-SetupLog -Component "Name" -ErrorMessage $_.Exception.Message
return $false
}Use color-coded output:
Write-Step "Installing component..." # Cyan - Section headers
Write-Success "Component installed" # Green - Success
Write-Skip "Already installed" # Yellow - Skipped
Write-ErrorMsg "Installation failed" # Red - Errorstype(scope): brief description
Longer description if needed.
Fixes #123
feat:New featurefix:Bug fixdocs:Documentationstyle:Formattingrefactor:Code restructuringtest:Testschore:Maintenance
feat(components): add ripgrep component
Add ripgrep as optional component for Yazi text search.
Related to #45
---
fix(setup): handle network timeout gracefully
Previously hung indefinitely. Now times out after 60s.
Fixes #78
---
docs(architecture): document failure recovery system
Add comprehensive guide for intelligent failure recovery.
git checkout -b feature/my-feature- Follow code standards
- Add tests if applicable
- Update documentation
# Validate code
.\Scripts\Validate-Code.ps1
# Test functionality
.\Scripts\Test.ps1git add .
git commit -m "feat(component): add amazing feature"git fetch upstream
git rebase upstream/mastergit push origin feature/my-feature- Go to GitHub
- Click "New Pull Request"
- Fill in template
- Link related issues
## Description
Brief description of changes.
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation
- [ ] Performance improvement
## Testing
- [ ] Validated with Validate-Code.ps1
- [ ] Tested with Test.ps1
- [ ] Manually tested functionality
## Related Issues
Fixes #123
## Screenshots
If applicable.# Code validation (required)
.\Scripts\Validate-Code.ps1
# Environment validation
.\Scripts\Test.ps1- Install from scratch
- Update existing installation
- Test with
-SkipOptional - Test failure scenarios
- Test on clean Windows install (VM)
docs/
├── getting-started/ # Installation, quick start
├── components/ # Component details
├── scripts/ # Script documentation
├── configuration/ # Customization guides
├── architecture/ # System design
└── development/ # Contributing, testing
- Use clear, concise language
- Include code examples
- Add troubleshooting sections
- Test all commands
- Update navigation in
mkdocs.yml
# Serve locally
mkdocs serve
# Build static site
mkdocs build- ✅ Code quality (PSScriptAnalyzer)
- ✅ Functionality (does it work?)
- ✅ Documentation (is it documented?)
- ✅ Tests (is it tested?)
- ✅ Maintainability (can others understand it?)
- Automated checks run (GitHub Actions)
- Maintainer reviews code
- Feedback provided
- You make changes
- Approved and merged
- Questions: Open a Discussion
- Bugs: Open an Issue
- Feature Ideas: Open an Issue for discussion
- Developer Reference - Command cheatsheet
- Testing Guide - Testing procedures
- Architecture - System design
- Be respectful and inclusive
- Welcome newcomers
- Provide constructive feedback
- Focus on the code, not the person
By contributing, you agree that your contributions will be licensed under the MIT License.