Skip to content

Commit f2e9658

Browse files
⚙️ [Maintenance]: Move coding standards to copilot-instructions and update parameter set naming guidelines (#551)
The coding standards document is moved from the repository root to the standard `.github/copilot-instructions.md` location recognized by GitHub Copilot, and the parameter set naming guidelines are updated with clearer, more comprehensive rules. ## Copilot instructions location The `CodingStandard.md` file is renamed to `.github/copilot-instructions.md`, aligning with the standard location for AI-assisted coding instructions. This is an internal maintenance change — no code or shipped artifact is affected. ## Parameter set naming guidelines The previous "Default Parameter Sets" section is replaced with a comprehensive "Parameter Set Naming" section providing clearer rules: - Functions with a single parameter set do not need a name or `DefaultParameterSetName`. - Functions with multiple parameter sets must use descriptive names that tell the user what each set does. - Generic names like `'__AllParameterSets'` or `'Default'` are explicitly prohibited. - Parameter sets should be named after the action or scope they represent (e.g., `'List repositories for authenticated user'`). - Public functions calling private functions should use the private function's synopsis as the parameter set name.
1 parent ca9d6f7 commit f2e9658

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,17 @@ Additions or adjustments to those defaults are covered in this document to ensur
3131
- Private function name format: **`Verb-GitHubNoun`** (same style but no aliases).
3232
- **`Get-`** functions must **not** include `[CmdletBinding(SupportsShouldProcess)]`. You only use `SupportsShouldProcess` on commands that change or remove data (`Set-`, `Remove-`, `Add-`, etc.).
3333

34-
- **Default Parameter Sets**
35-
- Do **not** declare `DefaultParameterSetName = '__AllParameterSets'`.
36-
- Only specify a `DefaultParameterSetName` if it is actually different from the first parameter set.
34+
- **Parameter Set Naming**
35+
- When a function has only one parameter set, a name is not needed and `DefaultParameterSetName` should not be set.
36+
- When a function has multiple parameter sets, **every** parameter set **must** have a descriptive name that tells
37+
the user what will happen when they use it. Set `DefaultParameterSetName` in the `[CmdletBinding()]` attribute to
38+
the most commonly used parameter set.
39+
- Do **not** use generic names like `'__AllParameterSets'` or `'Default'`.
40+
- Name parameter sets after the action or scope they represent, e.g. `'List repositories for authenticated user'`,
41+
`'Get a repository'`, `'List organization repositories'`.
42+
- For public functions that call private functions, use the **synopsis** of the called private function as the
43+
parameter set name (e.g. if the private function's synopsis is `List repositories for a user`, the parameter set
44+
name becomes `'List repositories for a user'`).
3745

3846
- **One API Call = One Function**
3947
- If you find that a single function is handling multiple distinct API calls, split it into multiple functions.

0 commit comments

Comments
 (0)