microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.13k stars 1.44k forks source link

Add support to export configuration for WinGet administrator settings #4211

Open denelon opened 7 months ago

denelon commented 7 months ago

Description of the new feature / enhancement

I want to be able to export the WinGet adminitrator settings using winget configure export.

The syntax might initially look like: winget configure export --package Microsoft.AppInstaller --module Microsoft.WinGet.DSC --resource WinGetAdministratorSettings --output exported.configuration.dsc.yaml

The DSC Resource would return the object containing the JSON formatted collection of settings suitable for WinGet to generate a configuration file.

The configuration file would contain the YAML necessary to install WinGet (Microsoft.AppInstaller) and then apply the administrator settings as they are configured on Windows for the current user.

Note: The dependsOn keyword would ensure the settings aren't applied until after WinGet is installed/upgraded.

Related to:

Proposed technical implementation details

Implement the new export method in a PowerShell DSC v2 class-based resource so I can capture the user settings for WinGet.

WinGet would likely need a new PowerShell cmdlet like "Export-DscResource" to call the export method on the resource. If no export method is available, the cmdlet would provide the appropriate error so WinGet as an orchestrator could provide this information to the user.

These are typically the settings only an administrator can apply. A few are included below for reference:

github-actions[bot] commented 7 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.