Winget Configure to Manage Windows Server 2025 apps and PowerShell Desired State
There is no question that winget will completely change how we manage and configure Windows Server apps and components. It will also help developers and IT professionals with desired state configurations. With the release of Windows Server 2025, Microsoft has included winget by default, and you can easily use it to manage and install apps on your Windows Server environment. Let’s look at winget commands and winget configure to use for Windows Server management and PowerShell desired state configuration.
Table of contents
Winget is included by default in Windows Server 2025
Winget is automatically included with Windows Server 2025. So, you don’t have to jump through hoops to install it in earlier Windows Server versions.
I think it is a great move by Microsoft to give admins and developers what they need to manage and configure Windows Server from the command line and give us an out-of-the-box package manager like we have had in Linux for years.
Winget commands to configure your Windows Server
You can use many commands with winget to configure your Windows Server.
Viewing parameters
To see the commands that are included and parameters you can use, just enter the following command into a Windows Terminal prompt:
winget
Viewing your version of Winget you have installed
Discovering software that needs to be updated
One of the first basic commands you will use with winget is the following command to upgrade all software:
winget upgrade
You will need to accept the agreement.
You should then see the packages that can be upgraded using winget.
Running the winget upgrade –all command
Now that we know what packages can be updated, we can run the command:
winget upgrade --all
This will begin the process of upgrading all packages that have upgrades available.
Configuring your winget settings
You can also configure your winget settings using the configuration file to customize the look and feel of your winget application, including things like the look of the progress bar, etc. To open your winget settings file you just type the following:
winget settings
Installing software like Visual Studio Code
To demonstrate just how easy it is to install tools and utilities you might need, you can install VSCode using the following command line command:
winget install vscode
Winget configure for PowerShell Desired State configuration
With Winget’s integration into Windows Server, you now have support for infrastructure as code (IaC) through PowerShell’s Desired State Configuration (DSC). This will allow for automating and codifying server setups to make configurations consistent across environments.
In this case, Winget is used as the orchestrator for DSC. It enhances DSC by allowing for configurations to be applied on demand. This is a great feature that beneficial for development scenarios and IT professionals using automation.
A sample configuration file from the Microsoft DevHome repository:
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
##########################################################################################################
# This configuration will install the tools necessary to get started with Python development on Windows #
# Reference: https://learn.microsoft.com/en-us/windows/python/beginners #
# #
# This will: #
# * Enable Developer Mode #
# * Install GitHub Desktop #
# * Install Python #
# * Install Visual Studio Code #
# #
##########################################################################################################
properties:
resources:
- resource: Microsoft.Windows.Developer/DeveloperMode
id: Enable
directives:
description: Enable Developer Mode
allowPrerelease: true
settings:
Ensure: Present
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: Python 3.12
directives:
description: Install Python 3.12
allowPrerelease: true
settings:
id: Python.Python.3.12
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: GitHub Desktop
directives:
description: Install GitHub Desktop
allowPrerelease: true
settings:
id: GitHub.GitHubDesktop
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: VisualStudio Code
directives:
description: Install Visual Studio Code
allowPrerelease: true
settings:
id: Microsoft.VisualStudioCode
source: winget
configurationVersion: 0.2.0
You can run the configuration of the YAML file by the command:
winget configure
You can also simply pass in a configuration file URL such as the URL for the sample YAML configuration above:
winget configure https://raw.githubusercontent.com/microsoft/devhome/main/docs/sampleConfigurations/Templates/Introduction/Python3.12/configuration.dsc.yaml
You will need to confirm the configuration operation to continue.
After a couple of minutes, the winget configure command completes successfully. We can see the packages that have been installed on the Windows Server 2025 instance.
Wrapping up
The winget configure and other winget commands are great new tools that can be used natively in Windows Server 2025. These commands will help take configuration of future generations of Windows server to the next level and provide developers and IT professionals easy built-in tools for configuration. The commands we have listed above provide the basics of working with Winget on Windows Server. Let me know in the comments if you are looking forward to using winget in your configuration management workflows on Windows Server 2025.