Fix duplicates in listing resources and add condition to manifests#1467
Open
SteveL-MSFT wants to merge 4 commits intoPowerShell:mainfrom
Open
Fix duplicates in listing resources and add condition to manifests#1467SteveL-MSFT wants to merge 4 commits intoPowerShell:mainfrom
SteveL-MSFT wants to merge 4 commits intoPowerShell:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens resource/extension discovery behavior by gating manifests on tool availability, removes duplicate resources (same type + version) from dsc resource list, and aligns MCP list_dsc_resources output with dsc resource list.
Changes:
- Add
conditionclauses to multiple resource/extension/adapter manifests to hide entries when required executables (e.g.,pwsh,sshd) aren’t present. - Deduplicate discovered manifests by type + version during discovery to prevent duplicate entries in
dsc resource list. - Update Pester tests and MCP resource listing behavior to reflect the new discovery/listing behavior; include missing SSHD subsystem manifests in packaging.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/sshdconfig/sshd-windows.dsc.resource.json | Adds condition to only surface resource when sshd is available. |
| resources/sshdconfig/sshd-subsystemList.dsc.resource.json | Adds condition to only surface resource when sshd is available. |
| resources/sshdconfig/sshd-subsystem.dsc.resource.json | Adds condition to only surface resource when sshd is available. |
| resources/sshdconfig/sshd_config.dsc.resource.json | Adds condition to only surface resource when sshd is available. |
| resources/PSScript/psscript.dsc.resource.json | Adds condition so PS7-based resource is hidden if pwsh isn’t installed. |
| extensions/powershell/powershell.dsc.extension.json | Adds condition so PS7 module discovery is hidden if pwsh isn’t installed. |
| extensions/appx/appx.dsc.extension.json | Adds condition intended to gate discovery based on PowerShell availability. |
| adapters/powershell/powershell.dsc.resource.json | Adds condition so adapter is hidden if pwsh isn’t installed. |
| adapters/powershell/PowerShell_adapter.dsc.resource.json | Adds condition so adapter is hidden if pwsh isn’t installed. |
| lib/dsc-lib/src/discovery/mod.rs | Reworks list_available aggregation to dedupe manifests by type + version. |
| dsc/src/mcp/list_dsc_resources.rs | Removes secondary sorting/deduping and returns resource summaries in discovery order. |
| dsc/tests/dsc_resource_list.tests.ps1 | Restricts discovery scope for tag/description tests; adds a duplicate-elimination test. |
| dsc/tests/dsc_mcp.tests.ps1 | Updates MCP list test to match non-unique projection/count semantics. |
| data.build.json | Ensures SSHD subsystem resource manifests are included in built packages. |
added 2 commits
April 7, 2026 16:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Summary
pwshin case PS7 isn't installeddsc resource listlist_dsc_resourceswas sorting an already sorted list, so removed the duplication