Introduction
Navigating through Windows Package Manager (WinGet) commands shouldn’t feel like deciphering a complex code. That’s why I created easy-to-follow Markdown maps and a guide to the Winget utility. This post serves as a gateway to ease your interaction with WinGet, making the management and installation of software packages a breeze. Through a structured exploration of WinGet commands in Markdown I aim to streamline WinGet experience. By the end, you’ll have a handy reference and a clearer understanding to efficiently manage software packages using WinGet.
Understanding WinGet
WinGet is a command-line utility that helps manage software packages on Windows. It’s essential for installing, updating, configuring, and removing software packages efficiently. Yet, its myriad commands can be overwhelming.
The Markdown Maps Solution
Markdown maps are designed to simplify this complexity. They provide a structured representation of commands, making it easier to find and understand the function of each command.
Creating the Maps
- Exporting to HTML: First, I exported all WinGet commands into individual Markdown files and then to HTML. This creates a visual map, making it easier to navigate through the commands.
- Master Markdown File: Created a master Markdown file with links to all HTML files. This way, you have a single page to click through all HTML files, making navigation a breeze.
Main WinGet Commands
WinGet offers a range of commands to manage software packages. Below is a list of the main commands along with a brief description:
- install: Install a given software package.
- show: Display information about a software package.
- source: Manage sources of software packages.
- search: Search for software packages.
- list: List installed software packages.
- upgrade: Upgrade software packages.
- uninstall: Uninstall a software package.
- export: Export a list of installed software packages to a file.
- import: Install software packages from a file.
- hash: Compute the hash of a local file.
- validate: Validate a manifest file.
- settings: Open settings in a text editor.
- features: Show the status of experimental features.
- pin: Manage package pins to control the upgrade behavior of packages.
- configure: Ensure the system matches a desired state as described by a provided configuration.
- download: Download the installer of a software package.
Each of these commands comes with its own set of options and arguments, which can be further explored in the Markdown maps and through the WinGet help command (winget –help).
Winget command examples
Winget export
winget export -o C:\WingetInstalledApps.json
Winget’s export command produces the following output. By using this output with the import command in Winget, these applications will be installed sequentially.
{
"$schema" : "https://aka.ms/winget-packages.schema.2.0.json",
"CreationDate" : "2023-10-23T19:45:21.203-00:00",
"Sources" :
[
{
"Packages" :
[
{
"PackageIdentifier" : "Microsoft.Edge"
},
{
"PackageIdentifier" : "Microsoft.EdgeWebView2Runtime"
},
{
"PackageIdentifier" : "Notepad++.Notepad++"
},
{
"PackageIdentifier" : "Microsoft.OneDrive"
},
{
"PackageIdentifier" : "7zip.7zip"
},
{
"PackageIdentifier" : "Oracle.JavaRuntimeEnvironment"
},
{
"PackageIdentifier" : "Adobe.Acrobat.Reader.64-bit"
},
{
"PackageIdentifier" : "Google.Chrome"
}
],
"SourceDetails" :
{
"Argument" : "https://cdn.winget.microsoft.com/cache",
"Identifier" : "Microsoft.Winget.Source_8wekyb3d8bbwe",
"Name" : "winget",
"Type" : "Microsoft.PreIndexed.Package"
}
}
],
"WinGetVersion" : "1.6.2771"
}
Winget import
Winget’s import command reads the exported JSON file and installs all the specified apps
winget import -i C:\WingetInstalledApps.json --accept-package-agreements --accept-source-agreements
PowerShell Module: Microsoft.WinGet.Client
If you didn’t know yet, then Microsoft also released the PowerShell module for Winget. Below are the cmdlets available in this module:
- Add-WinGetSource
- Assert-WinGetPackageManager
- Disable-WinGetSetting
- Enable-WinGetSetting
- Find-WinGetPackage
- Get-WinGetPackage
- Get-WinGetSettings
- Get-WinGetSource
- Get-WinGetUserSettings
- Get-WinGetVersion
- Install-WinGetPackage
- Remove-WinGetSource
- Repair-WinGetPackageManager
- Reset-WinGetSource
- Set-WinGetUserSettings
- Test-WinGetUserSettings
- Uninstall-WinGetPackage
- Update-WinGetPackage
Each cmdlet corresponds to a specific operation in WinGet, further streamlining the management of software packages.
Getting Started with Winget PowerShell Module
If you want to test out the Winget PowerShell module then follow these steps:
- Install PowerShell 7.X LTS (I tested the module with latest PowerShell 7.X but it didnt work)
Download and install the latest version of PowerShell from the official GitHub repository.
- Verify WinGet Installation
- Install WinGet PowerShell Module
Now, open PowerShell 7.x and run the following command to install the WinGet PowerShell Module:
Install-Module -Name Microsoft.WinGet.Client
- Verify Module Installation
Execute the following command to verify if the module has been installed successfully:
Get-Command -Module Microsoft.WinGet.Client
Winget PowerShell Module Examples
Install-WingetPackage
Install multiple applications using the Install-WingetPackage command.
$Apps = @("Google.Chrome","Notepad++.Notepad++","Adobe.Acrobat.Reader.64-bit","7zip.7zip")
$Apps | ForEach-Object {Write-Output -InputObject "***** Installing - $PSITEM"; Install-WinGetPackage -ID $PSITEM -Force -Mode Silent}
Bringing It All Together
With the Markdown maps and PowerShell module, navigating through WinGet commands becomes less daunting. These tools serve as handy references, aiding in the efficient management of software packages on Windows.
Conclusion
The Windows Package Manager (WinGet) is a powerful tool designed to automate and streamline software management on Windows. Through the Markdown maps and PowerShell module commands we’ve discussed, managing software becomes a more intuitive and less daunting task. With these resources at your fingertips, you’re now equipped to make the most out of WinGet, managing software packages efficiently.
Call to Actions (CTAs)
- Explore More: Delve deeper into WinGet’s capabilities by visiting the official documentation.
- Get Involved: Join the GitHub community to contribute or to stay updated on the latest enhancements in WinGet.
Download Markdown Maps (Free Registered Users & Premium Members)
Download the zip file and extract the files. Run the WINGET INDEX.html to access other commands.
FAQs
- Where can I find more detailed information on WinGet commands?
- The official documentation provides comprehensive information on all WinGet commands, options, and arguments.
- How can I contribute to the WinGet project?
- You can contribute by joining the GitHub community and following the guidelines provided for contributions.
- Where can I download the PowerShell module for WinGet?
- The PowerShell module can be downloaded from the GitHub repository.
- How do I report issues or suggest enhancements for WinGet?
- Issues and suggestions can be reported on the WinGet GitHub repository.
- Can I use WinGet to manage software on other operating systems
- WinGet is specifically designed for Windows and does not support other operating systems.