GeezerVison is showing github.com — Reject background pipelines as DSC resources by Copilot · Pull Request #2290 · PowerShell/PSScriptAnalyzer
Conversation
Copilot
AI
commented
Oct 28, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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 .
{} &
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Copilot
AI
changed the title
[WIP] Fix code as per comments in review thread
Reject background pipelines as DSC resources
Oct 28, 2026
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
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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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
There are no active review issues requiring changes.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
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.
|