Skip to content

Reject background pipelines as DSC resources - #2290

Merged
Christoph Bergmeister (bergmeister) merged 4 commits into
copilot/fix-auto-correct-aliasesfrom
copilot/fix-comments-in-review-thread
Oct 29, 2026
Merged

Christoph Bergmeister (bergmeister) merged 4 commits into
copilot/fix-auto-correct-aliasesfrom
copilot/fix-comments-in-review-thread

Conversation

Copilot AI commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Background pipelines inside fallback configuration ASTs could be mistaken for DSC resource declarations, suppressing expected Get- corrections.

  • Resource detection: Exclude background command pipelines and background following-line body pipelines.
  • Regressions: Cover both same-line and following-line & forms, including:
    Verb Argument {} &
    gci .
    {} &

Co-authored-by: bergmeister <9250262+bergmeister@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix code as per comments in review thread Reject background pipelines as DSC resources Oct 28, 2026
Co-authored-by: bergmeister <9250262+bergmeister@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unconditional test counts fail in Windows PowerShell 5.1 CI because the new guarded cases are excluded, so expectations must be version-dependent or the added cases moved to PowerShell 6+ tests.

1 open issue
What changed in this PR

This PR corrects fallback DSC resource detection so background pipelines remain eligible for alias expansion and missing Get- prefix corrections.

Changes:

  • Reject background command pipelines and background following-line body pipelines as DSC resources.
  • Add regression cases for both forms and update diagnostic counts.
File Description
Tests/​Rules/​AvoidUsingAlias.tests.ps1 Adds same-line and following-line background pipeline regressions.
Rules/​AvoidAlias.cs Adds Core-only background pipeline checks to DSC resource detection.

Review effort: Balanced

Comment thread Tests/Rules/AvoidUsingAlias.tests.ps1 Outdated
Co-authored-by: bergmeister <9250262+bergmeister@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues requiring changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@bergmeister
Christoph Bergmeister (bergmeister) marked this pull request as ready for review October 29, 2026 09:10
@bergmeister
Christoph Bergmeister (bergmeister) merged commit 3b14fd8 into copilot/fix-auto-correct-aliases Oct 29, 2026
9 checks passed
@bergmeister
Christoph Bergmeister (bergmeister) deleted the copilot/fix-comments-in-review-thread branch October 29, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants