May 25th, 2023
heart10 reactions

WinGet configuration Preview

Principal Product Manager

The Windows Package Manager team has been working on several things we’re sure you will be very excited about.

If you’ve been following the WinGet blogs, you’re already familiar with package management on Windows. We’ve got some goodies in store for you like package pinning, our new PowerShell module, and running WinGet in the system context. We’ve gotten lots of feedback on how WinGet has been a game changer in terms of time saved, convenience, and simplification when setting up a new Windows PC. WinGet configuration takes things to the next level!

WinGet configuration

Save time and skip the manual effort of setting up a new machine or onboarding a new project by using this unattended, reliable, and repeatable mechanism.

Remove the worry of searching for the right version of software, packages, tools and frameworks to download or settings to apply. WinGet configuration reduces this manual and error-prone process down to a single command with a WinGet configuration file. Just run winget configure <WinGet configuration file> in the command prompt and when it’s done, you are ready to code!

WinGet configuration was built on top of PowerShell DSC. It’s using a declarative YAML file that describes what the environment “looks like” when it’s configured. The file defines the environment in terms of DSC resources that can test the current state of the system and apply the necessary changes.

If you want to try this with WinGet, you will need to install one of our preview releases and enable the experimental feature. Learn more about WinGet configuration at Microsoft Learn. You can also try this functionality out in Dev Home. We’ve provided several sample configurations in the Dev Home project at GitHub.

WinGet PowerShell modules

Many of you have been asking about when a native PowerShell module would be available for WinGet. The text-based output from WinGet isn’t easy to parse, and that makes it much harder to use in scripts. The first “prerelease” module was shipped near the end of April 2023, and we published an update on May 12th.

Note: The module is not listed as “Prelease”, but it should be treated as such. The version published on May 12th is 0.2.0 and the Microsoft.WinGet.DSC module depends on Microsoft.WinGet.Client so it couldn’t be published as “Prerelease”. If you are comfortable with using a preview version:

Open up PowerShell (I like to use Windows Terminal and PowerShell 7) and run Install-Module Microsoft.WinGet.Client.