Skip to content

Commit 475d00b

Browse files
committed
Update CONTRIBUTION Coding guidelines to match PowerShell
1 parent 365a333 commit 475d00b

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

CONTRIBUTING.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,25 @@ Thank you for your interest in contributing! Your help is greatly appreciated.
44
This document outlines the process for contributing to the project.
55

66
## Coding Guidelines
7-
- MVVM architecture
8-
- SOLID principles
9-
- Clean Code practices
10-
- Unit testing with msTest
11-
- Dependency Injection
12-
- Asynchronous programming with async/await
13-
- Error handling and logging
14-
- Consistent naming conventions
15-
- XML documentation for public members
7+
8+
This project uses PowerShell for scripting. Follow these PowerShell-specific guidelines:
9+
10+
- Follow PowerShell best practices and the PowerShell Style Guidelines.
11+
- Use approved verbs for functions (see `Get-Verb`) and choose clear, descriptive function names.
12+
- Prefer advanced functions with `CmdletBinding()` so common parameters and `-Verbose`/`-Debug` are available.
13+
- Use strong typing and parameter validation attributes (`[Parameter()]`, `ValidateSet`, `ValidateNotNullOrEmpty`, etc.).
14+
- Support pipeline input for functions where appropriate and implement `Begin/Process/End` blocks when processing pipeline input.
15+
- Provide comment-based help for all public functions and scripts (examples, parameters, outputs).
16+
- Avoid aliases and use full cmdlet names in committed code (aliases are fine interactively).
17+
- Use `ShouldProcess`/`-WhatIf` for destructive operations and honor `-Confirm` when appropriate.
18+
- Use `Try/Catch` for error handling and throw or `Write-Error` as appropriate; prefer terminating errors when callers must act on failures.
19+
- Use `Write-Verbose`, `Write-Debug`, `Write-Warning`, and `Write-Error` for structured output and logging; do not write unstructured progress to stdout.
20+
- Keep formatting consistent (4-space indentation is recommended), avoid global variables, and keep functions focused and small.
21+
- Use `PSScriptAnalyzer` to lint scripts and address reported issues. Include a baseline or configuration if needed.
22+
- Organize modules with a `.psm1` and `.psd1` manifest; explicitly export public functions with `Export-ModuleMember`.
23+
- Write unit tests with `Pester` and place tests under a `tests/` folder. Run tests locally and in CI.
24+
- Avoid hard-coded credentials/secrets; use secure methods (secure strings, environment variables, or secret stores).
25+
- Use semantic versioning for modules and include a changelog for releases.
1626

1727
## How Can I Contribute?
1828

0 commit comments

Comments
 (0)