dism resource: add sourcePath parameter to allow for offline feature installs#1561
Open
Alex-shearing wants to merge 18 commits into
Open
dism resource: add sourcePath parameter to allow for offline feature installs#1561Alex-shearing wants to merge 18 commits into
Alex-shearing wants to merge 18 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for specifying DISM sourcePaths when enabling optional features/capabilities, enabling offline/alternate source installation scenarios.
Changes:
- Extend OptionalFeatureList/FeatureOnDemandList inputs/outputs with an optional
sourcePathsarray. - Validate
sourcePathsin set handlers and pass them into DISM calls. - Update resource schemas and docs to document the new property and examples.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/dism_dsc/src/optional_feature/types.rs | Adds source_paths field to OptionalFeatureList model. |
| resources/dism_dsc/src/optional_feature/set.rs | Validates/passes source_paths into enable operation; includes in output. |
| resources/dism_dsc/src/optional_feature/get.rs | Includes source_paths in Get output payload. |
| resources/dism_dsc/src/optional_feature/export.rs | Sets source_paths: None in Export output. |
| resources/dism_dsc/src/feature_on_demand/types.rs | Adds source_paths field to FeatureOnDemandList model. |
| resources/dism_dsc/src/feature_on_demand/set.rs | Validates/passes source_paths into add capability; includes in output. |
| resources/dism_dsc/src/feature_on_demand/get.rs | Includes source_paths in Get output payload. |
| resources/dism_dsc/src/feature_on_demand/export.rs | Sets source_paths: None in Export output. |
| resources/dism_dsc/src/dism.rs | Extends DISM FFI calls to pass SourcePaths/SourcePathCount. |
| resources/dism_dsc/optionalfeature.dsc.resource.json | Adds sourcePaths to resource schema. |
| resources/dism_dsc/featureondemand.dsc.resource.json | Adds sourcePaths to resource schema. |
| resources/dism_dsc/locales/en-us.toml | Adds localized error string for invalid source path. |
| docs/reference/resources/Microsoft/Windows/OptionalFeatureList/index.md | Documents sourcePaths and updates links. |
| docs/reference/resources/Microsoft/Windows/OptionalFeatureList/examples/enable-disable-optional-features.md | Adds example using offline source. |
| docs/reference/resources/Microsoft/Windows/FeatureOnDemandList/index.md | Documents sourcePaths and adds link. |
| docs/reference/resources/Microsoft/Windows/FeatureOnDemandList/examples/install-remove-feature-on-demand.md | Adds example using offline source. |
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.
To allow Windows optional features and feature on demand installs on Windows computers without internet access, the source paramter must be accessible to supply offline resources.
This is available as the 'Source' paramter in:
Install-WindowsFeaturePowerShell CmdLet: https://learn.microsoft.com/en-us/powershell/module/servermanager/install-windowsfeature?view=windowsserver2025-psEnable-WindowsOptionalFeaturePowerShell CmdLet: https://learn.microsoft.com/en-us/powershell/module/dism/enable-windowsoptionalfeature?view=windowsserver2025-psWindowsFeatureSetPowerShell DSC Resource: https://learn.microsoft.com/en-us/powershell/dsc/reference/resources/windows/windowsfeaturesetresource?view=dsc-1.1The changes include:
sourcePathproperty toMicrosoft.Windows/FeatureOnDemandListandMicrosoft.Windows/OptionalFeatureListschemassource_pathsparamter toenable_featureandadd_capabilityfunctions in dism.rs