-
Notifications
You must be signed in to change notification settings - Fork 125
Closed
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationgood first issueGood for newcomersGood for newcomersmaintenanceMaintenance work, no version bumpMaintenance work, no version bump
Milestone
Description
Issue Description
Several scripts use inconsistent patterns for the "direct invocation vs dot-sourced" entry point guard. Some use $MyInvocation.InvocationName -ne '.' while the logic placement varies. Standardizing this pattern would improve consistency and testability across all scripts.
Additional Context
Current variations:
Generate-PrReference.ps1: Usesif ($MyInvocation.InvocationName -ne '.') { ... }at the endGet-VerifiedDownload.ps1: Same pattern but with different error handlingPackage-Extension.ps1: Same pattern with extensive inline logic
Recommended approach:
- Ensure all scripts use the same guard pattern at the end of the file
- Extract main logic into a named function (e.g.,
Invoke-*) that the guard calls - Document the pattern in
scripts/README.mdfor future contributors
Testing:
- Dot-source each script and verify functions are available
- Run each script directly and verify expected behavior
- Run existing Pester tests that rely on dot-sourcing
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationgood first issueGood for newcomersGood for newcomersmaintenanceMaintenance work, no version bumpMaintenance work, no version bump