

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
123456# PowerShell Parameter Naming Conventions78## Purpose910This instruction defines the naming conventions for parameters in PowerShell scripts and modules. Consistent parameter naming improves code readability, maintainability, and usability for users of PowerShell cmdlets and functions.1112## Parameter Naming Rules1314### General Conventions15- **Singular Nouns**: Use singular nouns for parameter names even if the parameter is expected to handle multiple values (e.g., `File` instead of `Files`).16- **Use PascalCase**: Parameter names must use PascalCase (e.g., `ParameterName`).17- **Descriptive Names**: Parameter names should be descriptive and convey their purpose clearly (e.g., `FilePath`, `UserName`).18- **Avoid Abbreviations**: Avoid using abbreviations unless they are widely recognized (e.g., `ID` for Identifier).19- **Avoid Reserved Words**: Do not use PowerShell reserved words as parameter names (e.g., `if`, `else`, `function`).2021### Units and Precision22- **Include Units in Parameter Names**: When a parameter represents a value with units, include the unit in the parameter name for clarity:23 - `TimeoutSec` instead of `Timeout`24 - `RetryIntervalSec` instead of `RetryInterval`25 - `MaxSizeBytes` instead of `MaxSize`26- **Use Full Words for Clarity**: Spell out common terms to match PowerShell conventions:27 - `MaximumRetryCount` instead of `MaxRetries`28 - `MinimumLength` instead of `MinLength`2930### Alignment with Built-in Cmdlets31- **Follow Existing PowerShell Conventions**: When your parameter serves a similar purpose to a built-in cmdlet parameter, use the same or similar naming:32 - Match `Invoke-WebRequest` parameters when making HTTP requests: `TimeoutSec`, `MaximumRetryCount`, `RetryIntervalSec`33 - Follow common parameter patterns like `Path`, `Force`, `Recurse`, `WhatIf`, `Confirm`34- **Consistency Within Scripts**: If multiple parameters relate to the same concept, use consistent naming patterns (e.g., `TimeoutSec`, `RetryIntervalSec` both use `Sec` suffix).3536## Examples3738### Good Parameter Names39```powershell40param(41 [string[]]$File, # Singular, even though it accepts arrays42 [int]$TimeoutSec = 30, # Unit included43 [int]$MaximumRetryCount = 2, # Full word "Maximum"44 [int]$RetryIntervalSec = 2, # Consistent with TimeoutSec45 [string]$Path, # Standard PowerShell convention46 [switch]$Force # Common PowerShell parameter47)48```4950### Names to Avoid51```powershell52param(53 [string[]]$Files, # Should be singular: File54 [int]$Timeout = 30, # Missing unit: TimeoutSec55 [int]$MaxRetries = 2, # Should be: MaximumRetryCount56 [int]$RetryInterval = 2, # Missing unit: RetryIntervalSec57 [string]$FileLoc, # Avoid abbreviations: FilePath58 [int]$Max # Ambiguous: MaximumWhat?59)60```6162## Exceptions63- **Common Terms**: Some common terms may be used in plural form if they are widely accepted in the context (e.g., `Credentials`, `Permissions`).64- **Legacy Code**: Existing code that does not follow these conventions may be exempted to avoid breaking changes, but new code should adhere to these guidelines.65- **Well Established Naming Patterns**: If a naming pattern is well established in the PowerShell community, it may be used even if it does not strictly adhere to these guidelines.6667## References68- [PowerShell Cmdlet Design Guidelines](https://learn.microsoft.com/powershell/scripting/developer/cmdlet/strongly-encouraged-development-guidelines)69- [About Parameters - PowerShell Documentation](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parameters)70
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| PowerShell/PowerShell.github/instructions/build-and-packaging-steps.instructions.md · 55k | Copilot instructions | buildagent-behaviour | 58/100 | 13 days ago | |
| PowerShell/PowerShell.github/instructions/build-checkout-prerequisites.instructions.md · 55k | Copilot instructions | setupbuildstylearch+1 | 81/100 | 13 days ago | |
| PowerShell/PowerShell.github/instructions/code-review-branch-strategy.instructions.md · 55k | Copilot instructions | lint-formatstyletypesgit+1 | 62/100 | 13 days ago | |
| PowerShell/PowerShell.github/instructions/instruction-file-format.instructions.md · 55k | Copilot instructions | buildlint-formatstylearch+3 | 76/100 | 13 days ago | |
| PowerShell/PowerShell.github/instructions/log-grouping-guidelines.instructions.md · 55k | Copilot instructions | buildtestdo-not | 77/100 | 13 days ago | |
| PowerShell/PowerShell.github/instructions/onebranch-condition-syntax.instructions.md · 55k | Copilot instructions | buildstylearchdeployment+1 | 73/100 | 13 days ago | |
| PowerShell/PowerShell.github/instructions/onebranch-restore-phase-pattern.instructions.md · 55k | Copilot instructions | arch | 54/100 | 13 days ago | |
| PowerShell/PowerShell.github/instructions/onebranch-signing-configuration.instructions.md · 55k | Copilot instructions | buildstyledeployment | 62/100 | 13 days ago | |
| PowerShell/PowerShell.github/instructions/powershell-module-organization.instructions.md · 55k | Copilot instructions | buildteststylearch+2 | 69/100 | 13 days ago | |
| PowerShell/PowerShell.github/instructions/publishing-pester-result.instructions.md · 55k | Copilot instructions | testlint-formatstylearch+3 | 69/100 | 13 days ago | |
| PowerShell/PowerShell.github/instructions/script-module-file-format.instructions.md · 55k | Copilot instructions | lint-format | 54/100 | 13 days ago | |
| PowerShell/PowerShell.github/instructions/start-native-execution.instructions.md · 55k | Copilot instructions | buildstylearchgit+1 | 86/100 | 13 days ago | |
| PowerShell/PowerShell.github/instructions/start-psbuild-basics.instructions.md · 55k | Copilot instructions | buildtesting-strategydeploymentagent-behaviour | 54/100 | 13 days ago | |
| PowerShell/PowerShell.github/instructions/troubleshooting-builds.instructions.md · 55k | Copilot instructions | buildgitdeployment | 54/100 | 13 days ago | |
| PowerShell/PowerShell.github/instructions/build-configuration-guide.instructions.md · 55k | Copilot instructions | buildteststyletesting-strategy+2 | 74/100 | 13 days ago | |
| PowerShell/PowerShell.github/instructions/pester-set-itresult-pattern.instructions.md · 55k | Copilot instructions | setupstylearch | 62/100 | 13 days ago | |
| PowerShell/PowerShell.github/instructions/powershell-automatic-variables.instructions.md · 55k | Copilot instructions | stylearchgitdeployment+1 | 69/100 | 13 days ago | |
| PowerShell/PowerShell.github/instructions/pester-test-status-and-working-meaning.instructions.md · 55k | Copilot instructions | teststyle | 54/100 | 13 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 13 days ago | |
| pytorch/pytorch.github/copilot-instructions.md · 102k | Copilot instructions | setupbuildteststyle+5 | 100/100 | 13 days ago | |
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 63 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 13 days ago | |
| dotnet/roslyn.github/instructions/Compiler.instructions.md · 21k | Copilot instructions | buildteststylearch+3 | 99/100 | 6 days ago | |
| hiyouga/LlamaFactory.github/copilot-instructions.md · 74k | Copilot instructions | setupbuildtestlint-format+5 | 97/100 | 12 days ago | |
| rtk-ai/rtk.github/copilot-instructions.md · 75k | Copilot instructions | buildtestlint-formatstyle+2 | 97/100 | 13 days ago | |
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 13 days ago | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 31k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 6 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/powershell-powershell-github-instructions-powershell-parameter-naming-instructions)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.
Directory