-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement export WinGetPackage DSC resource #5074
base: master
Are you sure you want to change the base?
Conversation
@Gijsreyn what does the output look like for export. I want to make sure we have parity in the resource to be able to use "set" on the same output so logically (assuming there are no dependencies/conflicts), the resource can install those packages. |
@denelon here you have an example output: |
If you use |
Does it return an array of all packages? We have a command for generating a configuration file from the current state of the device: The current "export" / "import" format would still be supported, but I'd like to make the command smart enough that it could do either the packages.json format or the WinGet Configuration YAML format over the fullness of time. |
Thanks for both replies. Yes it indeed returns an array of all packages. I knew about the experimental feature; currently, it is YAML, if I'm not mistaken. It doesn't fully follow the DSC schematics. However, if the command does it with the V3 schema (which is also in experimental?) in the future, this PR becomes obsolete. |
We're adding experimental support to leverage DSC v3 for configuration (WinGet will also support the current configuration schema). We're planning to make WinGet a DSC v3 resource so we can use that to get/set/test/export. With the new experimental feature enabled at that point, we should be closer to where we want to be. |
How would you envision the work in this PR being used. I just want to make sure we're not confusing folks with all the different mechanisms :) As long as we have good guidance and the right use cases, I'm fine with adding export to the current Microsoft.WinGet.DSC resource, but I want to move intentionally :) |
Got it Demitrius. I was just filling the gap between winget-dsc and the one in this repository. Since I do note that it would be helpful to provide guidance for users. |
I understand. My main concern is that if someone were to run the following command, they would subsequently be able to run
|
Mhm... I get your point, Demitrius. I have a strong feeling that there is an underlying question hidden here. Executing the above command will not really work because the properties within the DSC resource are different unless they can be added to the command call itself. Nevertheless, the output of a DSC resource will not follow the schematics defined in WinGet. Now, I'm considering solutions to bridge the gap between WinGet and DSC. It would easily be solvable by providing a static method that converts it to a JSON string, expecting the format WinGet expects. Maybe a talk with Steve and Mikey would be worth a shot to discuss the options? |
Yeah, we're actively in discussions around how we're going to support both DSC v2 resources as well as DSC v3 resources, and how the WinGet Configuration Export is going to behave. |
Adds the export method on
WinGetPackage
class, just like some other resources in the winget-dsc repository.Microsoft Reviewers: Open in CodeFlow