Skip to content

Fix duplicates in listing resources and add condition to manifests#1467

Open
SteveL-MSFT wants to merge 4 commits intoPowerShell:mainfrom
SteveL-MSFT:appx-condition
Open

Fix duplicates in listing resources and add condition to manifests#1467
SteveL-MSFT wants to merge 4 commits intoPowerShell:mainfrom
SteveL-MSFT:appx-condition

Conversation

@SteveL-MSFT
Copy link
Copy Markdown
Member

@SteveL-MSFT SteveL-MSFT commented Apr 7, 2026

PR Summary

  • Add condition to several resource manifests that rely on pwsh in case PS7 isn't installed
  • Fix showing duplicate resources that have the same version from showing in dsc resource list
  • SSHD Subsystem resources were missing from package so added
  • MCP list_dsc_resources was sorting an already sorted list, so removed the duplication

@SteveL-MSFT SteveL-MSFT added this to the 3.2-Consider milestone Apr 7, 2026
@SteveL-MSFT SteveL-MSFT requested review from Copilot and tgauth and removed request for Copilot April 7, 2026 03:05
@SteveL-MSFT SteveL-MSFT marked this pull request as draft April 7, 2026 03:30
@SteveL-MSFT SteveL-MSFT marked this pull request as ready for review April 7, 2026 22:10
Copilot AI review requested due to automatic review settings April 7, 2026 22:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 condition clauses 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.

Steve Lee (POWERSHELL HE/HIM) (from Dev Box) added 2 commits April 7, 2026 16:32
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.

2 participants