GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add targeted test file option to build script by bergmeister · Pull Request #2259 · PowerShell/PSScriptAnalyzer

Conversation

@bergmeister

@bergmeister Christoph Bergmeister (bergmeister) commented Oct 27, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Add an optional -TestPath parameter to build.ps1 -Test so contributors can run a single Pester test file without launching the full suite. The path is resolved as a literal file path; omitting it preserves the existing full-suite behavior. Validated with the targeted UseConsistentIndentation test file and the full test suite.

This help with local development so that one doesn't need to keep spawning test shells and more importantly help Copilot verify changes more easily.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bergmeister
Add targeted test file option to build script
40453a5
Copilot AI balanced review requested due to automatic review settings October 27, 2026 18:10
@bergmeister
Christoph Bergmeister (bergmeister) requested a review from a team as a code owner October 27, 2026 18:10
Copilot started reviewing on behalf of Christoph Bergmeister (bergmeister) October 27, 2026 18:10
View session
Copilot AI reviewed Oct 27, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Regression tests are needed for Test-ScriptAnalyzer’s new path-selection behavior, including single-file selection, apostrophe preservation, invalid-path rejection, and the default four-directory selection.

1 open issue
  • Low severity Add regression tests for Test-ScriptAnalyzer path selection · New
What changed in this PR

Adds optional -TestPath support to build.ps1 -Test, allowing contributors to run a single Pester test file while preserving the default full-suite behavior.

Changes:

  • Exposes TestPath in the test parameter set and forwards it to the build module.
  • Resolves the supplied path literally, rejects directories, and escapes apostrophes when constructing the Pester invocation.
File Description
build.psm1 Selects and validates the requested test file, retaining the existing suite directories by default.
build.ps1 Adds the optional TestPath parameter and passes it to Test-ScriptAnalyzer.

Review effort: Balanced

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread build.psm1 Resolved

Uh oh!

There was an error while loading. Please reload this page.

Copilot started work on behalf of Christoph Bergmeister (bergmeister) October 27, 2026 18:17
View session
@bergmeister
Add Test-ScriptAnalyzer path selection tests
6a4cc32
Co-authored-by: bergmeister <[email protected]>
Copilot finished work on behalf of Christoph Bergmeister (bergmeister) October 27, 2026 18:21
@bergmeister
Christoph Bergmeister (bergmeister) requested a balanced review from Copilot October 27, 2026 18:21
Copilot started reviewing on behalf of Christoph Bergmeister (bergmeister) October 27, 2026 18:22
View session
Copilot AI reviewed Oct 27, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Test paths on custom PowerShell drives pass validation but fail in child processes because Resolve-Path.Path preserves drive names unavailable there; use .ProviderPath instead.

2 open issues
  • Medium severity Use ProviderPath for custom PowerShell drive paths · New
  • Low severity Add regression tests for Test-ScriptAnalyzer path selection

Review effort: Balanced

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread build.psm1 Resolved

Uh oh!

There was an error while loading. Please reload this page.

Copilot started work on behalf of Christoph Bergmeister (bergmeister) October 27, 2026 18:26
View session
@bergmeister
Use provider paths for test selection
9252e0a
Co-authored-by: bergmeister <[email protected]>
@bergmeister
Christoph Bergmeister (bergmeister) requested a balanced review from Copilot October 27, 2026 18:28
Copilot started reviewing on behalf of Christoph Bergmeister (bergmeister) October 27, 2026 18:29
View session
Copilot finished work on behalf of Christoph Bergmeister (bergmeister) October 27, 2026 18:29
Copilot AI reviewed Oct 27, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the optional -TestPath support.

1 open issue
  • Low severity Add regression tests for Test-ScriptAnalyzer path selection
1 resolved since last review
  • Medium severity Use ProviderPath for custom PowerShell drive paths

Review effort: Balanced

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bergmeister
Christoph Bergmeister (bergmeister) requested a review from Andy Jordan (andyleejordan) October 27, 2026 18:36
@bergmeister

Christoph Bergmeister (bergmeister) commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator Author

🟢 Approval recommended

No active review issues are recorded for the optional -TestPath support.

1 open issue

  • Low severity Add regression tests for Test-ScriptAnalyzer path selection

1 resolved since last review
Review effort: Balanced

Copilot fix

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot started work on behalf of Christoph Bergmeister (bergmeister) October 27, 2026 19:16
View session

Copilot AI commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

🟢 Approval recommended

No active review issues are recorded for the optional -TestPath support.

...

The requested regression coverage is already present in 6a4cc32 (single file, apostrophes, missing path, directory rejection, and the four default suite directories). I ran BuildModule.tests.ps1; all 20 tests pass.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot finished work on behalf of Christoph Bergmeister (bergmeister) October 27, 2026 19:18
@bergmeister
Christoph Bergmeister (bergmeister) requested a balanced review from Copilot October 27, 2026 19:19
Copilot started reviewing on behalf of Christoph Bergmeister (bergmeister) October 27, 2026 19:19
View session
Copilot AI reviewed Oct 27, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The path escaping leaves typographic apostrophes unchanged, causing generated PowerShell script blocks to fail parsing for valid paths containing those characters.

1 open issue
  • Medium severity Escape typographic apostrophes in PowerShell paths · New
1 resolved since last review
  • Low severity Add regression tests for Test-ScriptAnalyzer path selection

Review effort: Balanced

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread build.psm1 Resolved

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@andyleejordan Andy Jordan (andyleejordan) Awaiting requested review from andyleejordan
+1 more reviewer
Copilot code review Copilot Copilot left review comments
Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@bergmeister
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.