Support for DSC minimum version#5525
Merged
Merged
Conversation
yao-msft
previously approved these changes
Jun 13, 2025
| // Whether to request detailed traces from the processor. | ||
| // Read / Write | ||
| DiagnosticTraceEnabled, | ||
| // The path to the dsc.exe executable, as discovered. |
| else | ||
| { | ||
| this.Write(StreamType.Warning, $"Unrecognized value from FindDscStateMachine: {nextTransition ?? "<null>"}"); | ||
| throw new FileNotFoundException(Resources.DscExeNotFound, "dsc.exe"); |
Contributor
There was a problem hiding this comment.
Should we throw some other exception to show it's internal error?
| { | ||
| this.Write(StreamType.Error, Resources.ConfigurationInstallDscPackageFailed); | ||
| this.Write(StreamType.Verbose, installDSCv3.GetErrorMessage() ?? "<Unknown error>"); | ||
| this.Write(StreamType.Warning, Resources.ConfigurationInstallDscPackageFailed); |
Contributor
There was a problem hiding this comment.
Is there a reason we change to warning here?
Member
Author
There was a problem hiding this comment.
Error must be an ErrorRecord object, not a string. I can look at creating one, but there isn't an easy "from a string" method to do so.
Member
Author
There was a problem hiding this comment.
Also, I think that writing to Error and throwing an exception are effectively the same thing except for execution flow.
yao-msft
approved these changes
Jun 13, 2025
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.
Change
Adds a state machine for finding a version of DSC that meets our minimum requirements. It first attempts to use the stable release, falling back to the preview version if it is not new enough. This allows us to have functional, if less than ideal, user experience while we wait for DSC to ship a GA version.
Both callers (winget and PS module) are updated to handle the state machine transition mechanics, which means they need to install stable/preview versions when requested.
Also fixes some issues with the PS module install flow.
Validation
Manually confirmed that being up to date for both packages works, as well as having neither present.
Microsoft Reviewers: Open in CodeFlow