Skip to content

Instantly share code, notes, and snippets.

@denelon
Last active October 31, 2023 15:36
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save denelon/dc646f538b4ffd6993878cf545c7918f to your computer and use it in GitHub Desktop.
Save denelon/dc646f538b4ffd6993878cf545c7918f to your computer and use it in GitHub Desktop.
WinGet Configure Samples

Sample configuration.dsc.yaml files

These samples require the experimental configuration feature to be enabled. WinGet 1.5.863-preview or newer is required.

Add the following to your settings.json to enable this feature:

    "experimentalFeatures": {"dependencies": true, 
        "configuration": true
    }

winget configure show

Run winget configure show <path to *.dsc.yaml> to see the contents of the configuration.

winget configure

Run winget configure show <path to *.dsc.yaml> to run a configuration.

Samples

These need to be run as administrator. They demonstrate the "assert" section of configuration and are contrived examples to set and remove a machine scoped environment variable after asserting the presence or absence of the variable.

Note: Some of the DSC resources may not be published to the PowerShell Gallery yet.

GitHub Project Samples

@xakep139
Copy link

xakep139 commented Jun 4, 2023

@denelon the command under winget configure section should be fixed (show should be removed)

@xakep139
Copy link

xakep139 commented Jun 4, 2023

Links under GitHub Project Samples section are also broken...

@xakep139
Copy link

xakep139 commented Jun 4, 2023

@denelon
Copy link
Author

denelon commented Jul 27, 2023

The correct URL is:

https://aka.ms/dsc.yaml

@denelon
Copy link
Author

denelon commented Jul 27, 2023

We're updating Microsoft Learn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment