Skip to content

Conversation

@AmelBawa-msft
Copy link
Contributor

@AmelBawa-msft AmelBawa-msft commented Jun 12, 2025

⚙️ Settings DSC resource

📄 Get

PS C:\> wingetcreate dsc settings --get
{"settings":{"$schema":"https://aka.ms/wingetcreate-settings.schema.0.1.json","Telemetry":{"disable":true},"CleanUp":{"intervalInDays":7,"disable":false},"WindowsPackageManagerRepository":{"owner":"A","name":"B"},"Manifest":{"format":"yaml"},"Visual":{"anonymizePaths":true}}}

🖨️ Export

ℹ️ Settings resource Get and Export operation output states are identical.

PS C:\> wingetcreate dsc settings --export
{"settings":{"$schema":"https://aka.ms/wingetcreate-settings.schema.0.1.json","Telemetry":{"disable":true},"CleanUp":{"intervalInDays":7,"disable":false},"WindowsPackageManagerRepository":{"owner":"A","name":"B"},"Manifest":{"format":"yaml"},"Visual":{"anonymizePaths":true}}}

📝 Set

  • Action Full: When action is set to Full, the specified settings will be update accordingly and the remaining settings will be set to their default values.
  • Action Partial: When action is set to Partial, only the specified settings will be updated, and the remaining settings will remain unchanged.

🌕 Full

PS C:\> wingetcreate dsc settings --set '{"settings": { "Telemetry": { "disable": false }}, "action": "Full"}'
{"settings":{"$schema":"https://aka.ms/wingetcreate-settings.schema.0.1.json","Telemetry":{"disable":false},"CleanUp":{"intervalInDays":7,"disable":false},"WindowsPackageManagerRepository":{"owner":"microsoft","name":"winget-pkgs"},"Manifest":{"format":"yaml"},"Visual":{"anonymizePaths":true}},"action":"Full"}
["settings"]

🌗 Partial

PS C:\> wingetcreate dsc settings --set '{"settings": { "Telemetry": { "disable": true }}, "action": "Partial"}'
{"settings":{"$schema":"https://aka.ms/wingetcreate-settings.schema.0.1.json","Telemetry":{"disable":true},"CleanUp":{"intervalInDays":7,"disable":false},"WindowsPackageManagerRepository":{"owner":"microsoft","name":"winget-pkgs"},"Manifest":{"format":"yaml"},"Visual":{"anonymizePaths":true}},"action":"Partial"}
["settings"]

🧪 Test

  • Action Full: When action is set to Full, the specified settings will be tested accordingly, and the remaining settings will be tested against their default values.
  • Action Partial: When action is set to Partial, only the specified settings will be tested, and the remaining settings will be omitted from the test.

🌕 Full

PS C:\> wingetcreate dsc settings --test '{"settings": { "Telemetry": { "disable": false }}, "action": "Full"}'
{"settings":{"$schema":"https://aka.ms/wingetcreate-settings.schema.0.1.json","Telemetry":{"disable":true},"CleanUp":{"intervalInDays":7,"disable":false},"WindowsPackageManagerRepository":{"owner":"microsoft","name":"winget-pkgs"},"Manifest":{"format":"yaml"},"Visual":{"anonymizePaths":true}},"action":"Full","_inDesiredState":false}
["settings"]

🌗 Partial

PS C:\> wingetcreate dsc settings --test '{"settings": { "Telemetry": { "disable": false }}, "action": "Partial"}'
{"settings":{"$schema":"https://aka.ms/wingetcreate-settings.schema.0.1.json","Telemetry":{"disable":true},"CleanUp":{"intervalInDays":7,"disable":false},"WindowsPackageManagerRepository":{"owner":"microsoft","name":"winget-pkgs"},"Manifest":{"format":"yaml"},"Visual":{"anonymizePaths":true}},"action":"Partial","_inDesiredState":false}
["settings"]

@AmelBawa-msft AmelBawa-msft marked this pull request as ready for review June 16, 2025 16:35
@AmelBawa-msft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AmelBawa-msft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AmelBawa-msft AmelBawa-msft requested a review from mdanish-kh June 16, 2025 23:06
Copy link
Contributor

@mdanish-kh mdanish-kh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!

(P.S. maybe you can modify the PR description for the new changes to command syntax to help others who will review this PR :D)

@AmelBawa-msft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mdanish-kh
Copy link
Contributor

We may also want to update the README and also the doc folder for the new dsc command

winget-create/README.md

Lines 43 to 57 in f26390d

**WingetCreate** has the following commands:
| Command | Description |
| ------- | ----------- |
| [New](doc/new.md) | Command for creating a new manifest from scratch |
| [Update](doc/update.md) | Command for updating an existing manifest |
| [New-Locale](doc/new-locale.md) | Command for creating a new locale for an existing manifest |
| [Update-Locale](doc/update-locale.md) | Command for updating a locale for an existing manifest |
| [Submit](doc/submit.md) | Command for submitting an existing PR |
| [Show](doc/show.md) | Command for displaying existing manifests |
| [Token](doc/token.md) | Command for managing cached GitHub personal access tokens |
| [Settings](doc/settings.md) | Command for editing the settings file configurations |
| [Cache](doc/cache.md) | Command for managing downloaded installers stored in cache
| [Info](doc/info.md) | Displays information about the client |
| [-?](doc/help.md) | Displays command line help |

Copy link
Contributor

@mdanish-kh mdanish-kh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the docs and bearing with me :D

@yao-msft
Copy link

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AmelBawa-msft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AmelBawa-msft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AmelBawa-msft AmelBawa-msft enabled auto-merge (squash) June 25, 2025 22:39
@AmelBawa-msft AmelBawa-msft merged commit ca5f445 into main Jun 25, 2025
5 checks passed
@AmelBawa-msft AmelBawa-msft deleted the user/amelbawa/dsc branch June 25, 2025 23:06
@AmelBawa-msft AmelBawa-msft linked an issue Jul 9, 2025 that may be closed by this pull request
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.

Implement support for settings via DSC

4 participants