Skip to content

Add arg to pass file extensions to discover extensions#1598

Draft
SteveL-MSFT wants to merge 1 commit into
PowerShell:mainfrom
SteveL-MSFT:dsc-extensions-argKind
Draft

Add arg to pass file extensions to discover extensions#1598
SteveL-MSFT wants to merge 1 commit into
PowerShell:mainfrom
SteveL-MSFT:dsc-extensions-argKind

Conversation

@SteveL-MSFT

Copy link
Copy Markdown
Member

PR Summary

  • Add new extensionsArg to discover extensions that passes a comma separated string of all the manifest file extensions so they don't need to hardcode them and keep them up to date
  • Add support for discover extensions to return not just the path to a manifest but also the content of the manifest directly
  • Update Appx discover extension to use this new arg
  • Update PowerShell discover extension to use this new arg

PR Context

Fix #1222
FIx #1195

Copilot AI review requested due to automatic review settings June 25, 2026 04:22

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.

Pull request overview

This PR extends the DSC “discover” extension protocol to (1) pass DSC manifest file extensions into discover extensions at runtime and (2) allow discover extensions to return manifest content directly (not only a manifest path). It also updates the built-in Appx and PowerShell discover extensions plus adds test coverage for the new extensions-arg behavior.

Changes:

  • Added a new discover args kind (extensionsArg) and a new discover stdout shape supporting manifestContent.
  • Updated the Appx and PowerShell discover extensions to use the new extensions list argument.
  • Added a Pester test validating that the extensions list is received and used by a discover extension.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
lib/dsc-lib/src/extensions/discover.rs Adds extensionsArg processing and introduces manifestContent support in discover results.
lib/dsc-lib/src/discovery/command_discovery.rs Exposes manifest extension constants and makes load_adapted_resource_manifest public for reuse.
lib/dsc-lib/locales/en-us.toml Fixes the placeholder used for the invalid extension manifest message.
extensions/test/discover/discover.ps1 Updates the test discover extension to accept extensions input and emit manifestContent.
extensions/powershell/powershell.dsc.extension.json Passes the new extensionsArg to the PowerShell discover script.
extensions/powershell/powershell.discover.ps1 Consumes the passed extension list to drive discovery patterns.
extensions/appx/appx.dsc.extension.json Passes the new extensionsArg to the Appx discover script.
extensions/appx/appx-discover.ps1 Consumes the passed extension list to drive Get-ChildItem -Include patterns.
dsc/tests/dsc_extension_discover.tests.ps1 Adds a new Pester test ensuring extensionsArg is received and used.

Comment thread extensions/powershell/powershell.discover.ps1
Comment thread lib/dsc-lib/src/extensions/discover.rs
Comment thread lib/dsc-lib/src/extensions/discover.rs
Comment thread lib/dsc-lib/src/discovery/command_discovery.rs
Comment thread lib/dsc-lib/src/extensions/discover.rs
Comment on lines +117 to +126
let imported_manifest = match serde_json::from_value::<ImportedManifest>(manifest_value.clone()) {
Ok(manifest) => manifest,
Err(err) => {
// see if adapted resource manifest
let adapted_resource_manifest = match serde_json::from_value::<adapted_resource_manifest::AdaptedDscResourceManifest>(manifest_value.clone()) {
Ok(manifest) => manifest,
Err(err) => {
return Err(DscError::Json(err));
}
};
@SteveL-MSFT SteveL-MSFT marked this pull request as draft June 25, 2026 13:52
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.

Allow discover extensions to return the manifest and not just the path Add new arg kind for extensions to receive list of dsc file extensions

2 participants