Contributing to FleetDM-PowerShell
Thank you for your interest in contributing to the FleetDM-PowerShell module! This document provides guidelines and instructions for contributing.
Code of Conduct
By participating in this project, you agree to abide by our code of conduct: be respectful, inclusive, and constructive in all interactions.
How to Contribute
Reporting Issues
- Check existing issues to avoid duplicates
- Use issue templates when available
- Provide clear descriptions and steps to reproduce
- Include error messages and system information
Submitting Pull Requests
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
)
- Make your changes following our coding standards
- Write or update tests for your changes
- Run the build and tests locally
- Commit with clear messages (
git commit -m 'Add amazing feature'
)
- Push to your fork (
git push origin feature/amazing-feature
)
- Open a Pull Request with a clear description
Development Setup
Prerequisites
- PowerShell 5.1 or PowerShell Core 7+
- Git
- A FleetDM instance for testing (optional)
Setting Up Your Development Environment
- Clone the repository:
git clone https://github.com/Jorgeasaurus/FleetDM-PowerShell.git
cd FleetDM-PowerShell
- Install build dependencies:
- Build the module:
- Run tests:
Coding Standards
PowerShell Best Practices
- Use approved verbs for cmdlet names (Get-Verb)
- Follow PowerShell Practice and Style Guide
- Include comment-based help for all public functions
- Use PascalCase for cmdlet names and parameters
- Use camelCase for variables
- Avoid aliases in scripts
Code Style
- Indentation: 4 spaces (no tabs)
- Opening braces on same line
- Use full cmdlet names (no aliases)
- Include parameter types
- Use ShouldProcess for destructive operations
Example:
function Get-Example {
<#
.SYNOPSIS
Gets an example object
.DESCRIPTION
Detailed description of what this function does
.PARAMETER Name
The name of the example
.EXAMPLE
Get-Example -Name "Test"
#>
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$Name
)
process {
# Implementation here
}
}
Testing
- Write Pester tests for all new functionality
- Maintain or improve code coverage
- Mock external dependencies
- Test both success and failure scenarios
- Include edge cases
Documentation
- Update README.md for new features
- Include comment-based help for cmdlets
- Update CHANGELOG.md following Keep a Changelog format
- Add examples for complex functionality
Build System
This project uses PSStucco standards with psake for building:
./build.ps1 -Task Build
- Build the module
./build.ps1 -Task Test
- Run Pester tests
./build.ps1 -Task Analyze
- Run PSScriptAnalyzer
./build.ps1 -Task Deploy
- Deploy to local module path
Release Process
- Update version in module manifest
- Update CHANGELOG.md
- Create a git tag:
git tag v1.0.0
- Push tags:
git push origin --tags
- GitHub Actions will automatically publish to PowerShell Gallery
Questions?
Feel free to open an issue for questions or discussions about potential changes.