You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
style: drop named parameters from single-argument calls in test scaffolding
Apply the scoped named-parameter rule to the template's test scaffolding: name
parameters only on calls that pass two or more arguments; single-argument calls
stay positional. Reverts over-naming such as `Test-Path -Path $path`,
`Get-Module -Name $name`, and `Get-Help -Name $command` to positional across the
Help/Manifest/Meta tests, MetaFixers, and the Unit test templates.
A trailing switch counts as an argument, so `Split-Path -Path $x -Parent`,
`Get-Content -Path $x -Raw`, `Get-ChildItem -Path $x -Recurse`, and
`Sort-Object -Property 'Name' -Unique` keep their names, as do genuinely
multi-value calls (`Join-Path`, `Get-Content -Path -Encoding -Raw`,
`Get-Command -Name -CommandType`) and `Test-Path -LiteralPath` (whose positional
slot binds to -Path). Common parameters such as -ErrorAction and -Verbose do not
count toward the threshold.
Canonical-source fix for the over-naming that propagated into the consumer
test-scaffolding PRs; pairs with the rule scoping in
tablackburn/ai-agent-instruction-modules#25.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ own `CHANGELOG.md` (generated from `CHANGELOG.template.md` during init).
18
18
### Changed
19
19
20
20
- Renamed required PowerShell Gallery publish secret `PS_GALLERY_KEY` → `PSGALLERY_API_KEY` so the secret name matches the env var name PowerShellBuild reads (eliminating the previous mapping caveat). New modules created from the template after this change pick up the new name automatically. **Migration for existing modules:** create a new `PSGALLERY_API_KEY` repo secret with the same value, update `.github/workflows/PublishModuleToPowerShellGallery.yaml` to reference `secrets.PSGALLERY_API_KEY`, then delete the old `PS_GALLERY_KEY` secret.
21
+
- Test scaffolding (`tests/Help.tests.ps1`, `tests/Manifest.tests.ps1`, `tests/Meta.tests.ps1`, `tests/MetaFixers.psm1`, and the `tests/Unit/` templates) no longer names parameters on single-argument calls (e.g. `Test-Path $path`, `Get-Module $name`, `Get-Help $command`), matching the scoped named-parameter rule — name parameters only when a call passes two or more arguments. A trailing switch counts as an argument, so `Split-Path -Path $x -Parent`, `Get-Content -Path $x -Raw`, and `Get-ChildItem -Path $x -Recurse` keep their names, as do genuinely multi-value calls (`Join-Path`, `Get-Command -Name … -CommandType …`) and `Test-Path -LiteralPath`.
0 commit comments